Hi,
Plz help me out .I need to fetch the body of a mail in text format so that i can store it in a database.
i have got all the fields of the mail ....but what if the body of the mail is multipart...i dont care about the attachments...i just want the body in plain text...here is how far i went
<?php
$inbox = imap_open ("{myserver/imap}Inbox", "myid", "mypass");
$total = imap_num_msg($inbox);
if ($total > 0)
{
for($x=$total; $x>0; $x--)
{
$headers = imap_header($inbox, $x);
$structure = imap_fetchstructure($inbox, $x);
$text = imap_fetchbody($inbox,$x,"1.1");//here's the problem
echo "$text";
}
}
?>
what do i do to fetch the body of mail in text format?
Thanx in advance
Greg