Hi I’m sending an html email using the mail() function, my problem is it seems to put a lot of ! in the html code. Is there anyway to stop this happening?
If I echo the email body rather than sending it , it works fine. Its only when I email it.
Any help would be appreciated.
Cut down version of the code is :
$headers .= "From: test <$re_email>\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$email_body.="<table width=550 border=0 cellspacing=0 cellpadding=0 bgcolor=#dddddd class=products>";
$email_body.="<tr><td>Customers Details</td></tr>";
$email_body.="</table><br>";
mail("homer@simpson.com","test",$email_body,$headers);
Problems with sending html emails using mail()
Moderator: General Moderators
Don't think you need 3 bodies?`Try this:
$headers .= "From: test <$re_email>\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$email_body.="<table width=550 border=0 cellspacing=0 cellpadding=0 bgcolor=#dddddd class=products> <tr><td>Customers Details</td></tr> </table><br>";
mail("homer@simpson.com","test",$email_body,$headers);
$headers .= "From: test <$re_email>\n";
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
$email_body.="<table width=550 border=0 cellspacing=0 cellpadding=0 bgcolor=#dddddd class=products> <tr><td>Customers Details</td></tr> </table><br>";
mail("homer@simpson.com","test",$email_body,$headers);
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
You need to send the e-mail with a MIME type check the man entry for mail() for all the headers that need to be set when sending HTML e-mail. Don't know if this'll solve the problem but it might help.
Zeceer - that shouldn't make any difference, all that he's doing is concenating the HTML so that he doesn't have to type it all on one line.
Mac
Zeceer - that shouldn't make any difference, all that he's doing is concenating the HTML so that he doesn't have to type it all on one line.
Mac