Share this question

Welcome to Teachnovice Q&A, where you can ask questions and receive answers from other members of the community.

This is a collaboratively edited question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

PHP How to set a bitmask parameter. imap_fetchbody adds '=' to string

0 like 0 dislike
16,028 views

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);
asked Feb 27, 2012 by anonymous  
edited Jul 4, 2012 by sarwana

1 Answer

0 like 0 dislike

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

answered Jul 2, 2012 by anonymous  
edited Jul 4, 2012 by sarwana
I'm currently using something similar at the moment as a work-around. Thank you for the input!
...