I’m building a simple email program.
I use this to get the HTML: $bodyHTML = imap_fetchbody($imap, $i, 2);
When I use: $bodyHTML = imap_fetchbody($imap, $i, 1.2); the output is empty…
When I echo the $bodyHTML. I see this:
=EF=BB=BF<!DOCTYPE HTML PUBLIC =22-//W3C//DTD HTML 4.0 Transitional//EN=22>
<HTML><HEAD><TITLE>Country Linedance Just Can't See It www.country4all.eu</=
TITLE>
<META name=3DGENERATOR content=3D=22MSHTML 8.00.6001.19019=22>
<STYLE>A:hover {
=09BACKGROUND-COLOR: yellow; COLOR: rgb(0,0,153)
}
</STYLE>
Now my question is: how can I set this correctly to HTML? (So it shows in the browser)
UPDATE:
I found that this is a common problem. People advice $bodyHTML = imap_fetchbody($imap, $i, 1.2); but most of the times this doesn’t work. So people use this:
1) $bodyHTML = imap_fetchbody($imap, $i, 2);
2) quoted_printable_decode($bodyHTML)
You can use the
quoted_printable_decodemethod to decode the encoded special characters (like=22) to regular characters.