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(t ime()))."";
// set email headers
$header = "Return-Path: jack_t1234@adnd realm.net\r\n";
$header.= "From: Theo <jack_t1234@adn drealm.net>\r\n ";
$header.= "MIME-Version: 1.0\r\n";
$header.= "Content-Type: multipart/alternative;\r\ n
boundary=\"$bou ndary\"\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><f ont
size=3>Hello</font></body></html>\r\n\r\n";
// combine headers & message
$mesg = $txt_head.$htm_ head.$boundary. "--";
// send email out
mail ("jack_t1234@ad ndrealm.net","t est with dual
encoding",$mesg ,$header);
?>
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(t ime()))."";
// set email headers
$header = "Return-Path: jack_t1234@adnd realm.net\r\n";
$header.= "From: Theo <jack_t1234@adn drealm.net>\r\n ";
$header.= "MIME-Version: 1.0\r\n";
$header.= "Content-Type: multipart/alternative;\r\ n
boundary=\"$bou ndary\"\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><f ont
size=3>Hello</font></body></html>\r\n\r\n";
// combine headers & message
$mesg = $txt_head.$htm_ head.$boundary. "--";
// send email out
mail ("jack_t1234@ad ndrealm.net","t est with dual
encoding",$mesg ,$header);
?>
Comment