php imap_fetchbody error in reading the body

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sathish_nec
Forum Newbie
Posts: 1
Joined: Thu Apr 19, 2012 10:11 am

php imap_fetchbody error in reading the body

Post 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
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: php imap_fetchbody error in reading the body

Post 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.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply