complex05 Posted June 21, 2006 Share Posted June 21, 2006 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Š‚¢ºžjyr?º¶²‚þu?þ¶µzºj®j‚qvžº²Ÿµ²þ¶µ{r‰¶·jzµ†¢µžyy{rÊŠµ?6w¶Ê¶?®¶—ªyºÊz¶‰Šzvz²w¶¹•~i²Š†?™¢¶ºj¯µ²§þµz¦•–uWhat 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!~ThanksBarry Quote Link to comment https://forums.phpfreaks.com/topic/12551-html-e-mail-mime-types/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.