Jump to content

Recommended Posts

Hello,

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!"));

//HTML
//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!~

Thanks

Barry
Link to comment
https://forums.phpfreaks.com/topic/12551-html-e-mail-mime-types/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.