Mail/mimeDecode error
| From: | Manish Shah | Date: | Wed, 14 Sep 2005 20:20:46 +0000 |
| Subject: | Mail/mimeDecode error | ||
| Groups: | php.pear.dev | ||
| Request: | Send a blank email to pear-dev+get-39820@lists.php.net to get a copy of this message | ||
I'm using pear mimeDecode to process incoming emails with php. I've
been getting an error with emails sent from outlook.
PHP Notice: Undefined property: body in
/home/httpd/vhosts/woomenow.com/redir_test.php on line 44
I dont know why this is happening as it works with emails from gmail
and apple mail.
Here is a snippet of my code:
fp = fopen("/home/httpd/vhosts/woomenow.com/email.txt", "r");
$email = "";
while(!feof($fp)) {
$email .= fread($fp, 1024);
}
//mail("mnshah@gmail.com", "woomenow message", $email);
fclose($fp);
$params = array();
$params['include_bodies'] = true;
$params['decode_bodies'] = true;
$params['decode_headers'] = true;
//decode the email
$decode = new Mail_mimeDecode($email, "\r\n");
$structure = $decode->decode($params);
$all_emails = $structure->headers['to'].",
".$structure->headers['cc'];
$emails = explode(",",$all_emails);
....
$msg = $structure->body;
The last line is the one causing the error
Thanks for the help.