fetching subject line from POP-mail using PHP

Glaanieboy

OSNN Veteran Addict
Joined
6 Mar 2002
Messages
2,628
This is part of the code I use to check my mail:
Code:
for ($X=1;$X<=$num_messages;$X++){

 $header = imap_headerinfo($mbox,$X);
 $subject = $header->fetchsubject;
 $message = imap_body($mbox,$X);
 
print "Message number $X:<BR>
 Subject: <B>$subject</B><BR>";
 $message = htmlspecialchars($message);
 print str_replace("\n", "<br>", $message)."<BR>************************************<BR>";
}

I've got one problem: PHP doesn't fetch the subject line for some reason. The problem must be in $subject = $header->fetchsubject, but all of the examples on PHP.net I've seen, use this piece of code. I tried $header->subject, $header['fetchsubject'], but nothing there. I know that there is a subject line in the message(s), because there is one in the test message I sent. Please help me.
 
I reread the additional messages on PHP.net and I found that imap_headerinfo($mbox,$X,80,80) was the trick.
 
I am having trouble with my mail script cause of this problem ! the newest PHP i have works just a bit different.
 
He was referring to the 'newest' version. I guessed he meant 5.

(does it matter? NOT!)
 
nah 5 is still pretty much beta, if I didnt use allhope for beta testing code and so on I would give it a try but I dont wanna
 
Ah oh well I cant be right all the time and its not like I could get on your server and check :p
 

Members online

No members online now.

Latest profile posts

Also Hi EP and people. I found this place again while looking through a oooollllllldddd backup. I have filled over 10TB and was looking at my collection of antiques. Any bids on the 500Mhz Win 95 fix?
Any of the SP crew still out there?
Xie wrote on Electronic Punk's profile.
Impressed you have kept this alive this long EP! So many sites have come and gone. :(

Just did some crude math and I apparently joined almost 18yrs ago, how is that possible???
hello peeps... is been some time since i last came here.
Electronic Punk wrote on Sazar's profile.
Rest in peace my friend, been trying to find you and finally did in the worst way imaginable.

Forum statistics

Threads
62,015
Messages
673,494
Members
5,621
Latest member
naeemsafi
Back