multipart/alternative e-mails; text/plain and text/htmlAccording to RFC 1341 and http://www.freesoft.org/CIE/RFC/1521/18.htm:
MIME-Version: 1.0 From: Foo <foo@bar.com> Subject: Test mail Content-Type: multipart/alternative;boundary=np4f343da3bee89
This is a MIME encoded message. --np4f343da3bee89 Content-type: text/plain;charset=utf-8 This is the text/plain version. --np4f343da3bee89 Content-type: text/html;charset=utf-8 This is the <b>text/html</b> version. --np4f343da3bee89--
<?php$boundary=uniqid('np');$headers="MIME-Version: 1.0\r\n";$headers.="From: Foo <foo@bar.com>\r\n";$headers.="Subject: Test mail\r\n";$headers.="Content-Type: multipart/alternative;boundary=". $boundary ."\r\n";$message="This is a MIME encoded message.";$message.="\r\n\r\n--". $boundary ."\r\n";$message.="Content-type: text/plain;charset=utf-8\r\n\r\n";$message.="This is the text/plain version.";$message.="\r\n\r\n--". $boundary ."\r\n";$message.="Content-type: text/html;charset=utf-8\r\n\r\n";$message.="This is the <b>text/html</b> version.";$message.="\r\n\r\n--". $boundary ."--";//mail('bar@foo.com', 'Test mail', $message, $headers);?>