Jump to content


Photo

PHP PLAIN TEXT EMAIL TO HTML EMAIL


  • Please log in to reply
1 reply to this topic

#1 nazca

nazca
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 17 June 2006 - 03:27 AM

[img src=\"style_emoticons/[#EMO_DIR#]/excl.gif\" style=\"vertical-align:middle\" emoid=\":excl:\" border=\"0\" alt=\"excl.gif\" /] I need help, I am trying to send a php email as an html email. Below is part of the code
and $orderText represents the actual content.

I am trying to place a three row table with color sent to the customer's email.
The first row is the name, second row the content, and third link back to my site.
How do send this using php.... I tried reading the tutorial, but over my head...
Tried to change the content-type to text/html or text/multipart and still no luck.

Please help..........


if($bSendEmail){
$headers = "MIME-Version: 1.0\n";
$headers .= "From: " . $sEmail . " <" . $sEmail . ">\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
//$headers .= "To: " . $sEmail . " <" . $sEmail . ">\n";
mail($sEmail, $xxOrdStr, $orderText, $headers);
}
// And one for the customer
$headers = "MIME-Version: 1.0\n";
$headers .= "From: " . $sEmail . " <" . $sEmail . ">\n";
//$headers .= "To: " . $custEmail . " <" . $custEmail . ">\n";
$headers .= "Content-type: text/plain; charset=iso-8859-1\n";
mail($custEmail, $xxTnxOrd, $xxTouSoo . "\n\n" . $orderText, $headers);

#2 poirot

poirot
  • Members
  • PipPipPip
  • Advanced Member
  • 646 posts
  • LocationAustin, TX

Posted 17 June 2006 - 03:31 AM

Change:

$headers .= "Content-type: text/plain; charset=iso-8859-1\n";

to

$headers .= "Content-type: text/html; charset=iso-8859-1\n";

And you should get a HTML mail.
~ D Kuang




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users