Jump to content


This topic is now archived and is closed to further replies.


HTML E-Mail & Mime Types

Recommended Posts


I just wrote a script and used a code snippet I found on the web.

$headers = "From: Web Form\r\n";

//specify MIME version 1.0
$headers .= "MIME-Version: 1.0\r\n";

//unique boundary
$boundary = uniqid("HTMLDEMO");

//tell e-mail client this e-mail contains//alternate versions
$headers .= "Content-Type: multipart/alternative" .
"; boundary = $boundary\r\n\r\n";

//message to people with clients who don't
//understand MIME
$headers .= "This is a MIME encoded message.\r\n\r\n";

//plain text version of message
//$headers .= "--$boundary\r\n" .
// "Content-Type: text/plain; charset=ISO-8859-1\r\n" .
// "Content-Transfer-Encoding: base64\r\n\r\n";
//$headers .= chunk_split(base64_encode("This is the plain text version!"));

//version of message
$headers .= "--$boundary\r\n" .
"Content-Type: text/html; charset=ISO-8859-1\r\n" .
"Content-Transfer-Encoding: base64\r\n\r\n";
$headers .= chunk_split(base64_encode($message));

Everything works fine except one thing, at the end of the email the program generates, it adds this:

µ¦åyÇ¥––?v)à‡–[)iȧ€ •«Ö•ëµÓ™ïv×jº çþ׶»µÓ™·J){ûµÝÓ­Ó¯wû¶»N)=ê¡Üºy·?ª®Êj[j)ž‰éþ×wyžØþ׶¿i¹¦µ¦yÇ––v)‡–[iÈ€••µ¢zƒ®Š~…®Š‰þvº…¢žjjzµanµ®tʶ?¢Á§‡¶±±r?zŠ‚¢ºžj­yr?º¶²‚þu?þ¶µzºj®j‚qvžº²Ÿµ²þ¶µ{r‰¶·jzµ†¢µžyy{rÊ­Šµ?6w¶ʶ?®¶—ªyºÊz¶‰Šzvz²w¶¹•~i²Š†?™¢¶ºj¯µ²§þµz¦•–u

What could this be? Originally I used the code snippet found on php.net about HTML email, but for some reason it didn't work on this particular server.

Any help would be greatly appreciated!~



Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.