I'm tring to send out a dual encoded message in html and text message.
From everything that I have read and seen as incoming messages this
should work but it doesn't. Any ideas?
TIA,
Gary Smith
<?php
// generate MIME boundary
echo uniqid(time())."<br>";
$boundary = "----=".md5(uniqid(time()))."";
// set email headers
$header = "Return-Path: ja********@adndrealm.net\r\n";
$header.= "From: Theo <ja********@adndrealm.net>\r\n";
$header.= "MIME-Version: 1.0\r\n";
$header.= "Content-Type: multipart/alternative;\r\n
boundary=\"$boundary\"\r\n";
// set text section
$txt_head = $boundary."\r\n";
$txt_head.= "Content-Type: text/plain;\r\n
charset=\"iso-8859-1\"\r\n";
$txt_head.= "Content-Transfer-Encoding: quoted-printable\r\n\r\n";
$txt_head.= "some simple text\r\n";
// set html section
$htm_head = $boundary."\r\n";
$htm_head.= "Content-Type: text/html;\r\n
charset=\"iso-8859-1\"\r\n";
$htm_head.= "Content-Transfer-Encoding: quoted-printables\r\n\r\n";
$htm_head.= "<html><body><font
size=3>Hello</font></body></html>\r\n\r\n";
// combine headers & message
$mesg = $txt_head.$htm_head.$boundary."--";
// send email out
mail ("ja********@adndrealm.net","test with dual
encoding",$mesg,$header);
?>