Jump to content

Archived

This topic is now archived and is closed to further replies.

nazca

PHP PLAIN TEXT EMAIL TO HTML EMAIL

Recommended Posts

[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);

Share this post


Link to post
Share on other sites
Change:

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

to

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

And you should get a HTML mail.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.