Glaanieboy
OSNN Veteran Addict
- Joined
- 6 Mar 2002
- Messages
- 2,628
This is part of the code I use to check my mail:
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.
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.