Nightfire
12-24-2002, 08:19 PM
Ok, this is really baffling me. I'm trying to send an html email off, but all I'm getting is the html shown in the email. This is what's baffling me... The script below works with html
<?php
$to="your@email.com";
$subject="My Test Email";
$body="<html><body><h1>My Test Email Works!</h1></body></html>";
$headers = "MIME-Version: 1.0";
$headers .= "Content-type: text/html; charset=iso-8859-1";
$headers .= "From: My Name <myscript@mydomain.com>";
mail("$to","$subject","$body","$headers");
?>
But if I try to change $body to include
<html><body><h3>Merry Christmas</h3>Have a great Christmas and New Year from everyone at etc etc, you get the idea</body></html>
I just get it all printed in the email :confused: I've stripped most the html out too, thinking that emails couldn't contain stylesheets, title tags, etc
<?php
$to="your@email.com";
$subject="My Test Email";
$body="<html><body><h1>My Test Email Works!</h1></body></html>";
$headers = "MIME-Version: 1.0";
$headers .= "Content-type: text/html; charset=iso-8859-1";
$headers .= "From: My Name <myscript@mydomain.com>";
mail("$to","$subject","$body","$headers");
?>
But if I try to change $body to include
<html><body><h3>Merry Christmas</h3>Have a great Christmas and New Year from everyone at etc etc, you get the idea</body></html>
I just get it all printed in the email :confused: I've stripped most the html out too, thinking that emails couldn't contain stylesheets, title tags, etc