Page 1 of 1

php imap_fetchbody error in reading the body

Posted: Thu Apr 19, 2012 10:14 am
by sathish_nec
Hi,

I am trying to write a code to read through a body of a mail into an array(line by line) and store some of the values in to database. I used the imap_fetchbody like this:

imap_fetchbody($this->conn,$msgid,1)

i can get the most of the data in the body but then data wrapped inside < and > tags are not there including the < and > symbols. I am reading the email stored in Microsoft outlook.

Some email details are :

Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I believe that the data within the "<" and ">" tags inclusive got truncated because the encoding.

Please can you let me know if there is any other function that I can use to get the data as it is or if I am missing some thing in the current function.

Any help is greatly appreciated.

Thanks in advance.

Sathish

Re: php imap_fetchbody error in reading the body

Posted: Thu Apr 19, 2012 2:19 pm
by pickle
imap_fetchbody() only retrieves a section of the body. I'm not really familiar with it - but perhaps the < & > are delimiting a new section? Maybe imap_body() would work better.