Question

I'm using some PHP imap_functions to automatically process emails.

However the emails have to stay in HTML format and the function imap_fetchbody seems to add '=' as the end of some lines meaning my html parser cannot parse it correctly.

I think it is because FT_INTERNAL needs setting but whatever I try it still does the same.

How do I add a bitmask set of parameters or stop the function from doing this.

$content .= imap_fetchbody($inbox, $email_number, "1", FT_UID & FT_PEEK & FT_INTERNAL);
$content .= imap_fetchbody($inbox, $email_number, "1", 124); 
Was it helpful?

Solution

Not a great solution, but it works fine for me:


$body = preg_replace("/=(\r?)\n/", '', imap_fetchbody($mailbox, $message, $part));

Hope it helps in some way

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top