I have a email problem with the following code. This was perfectly working fine and sending a HTML email earlier. Recently we have moved to a new server and the email does not display the HTML, it just displays as a text message. Can some one advice me in this regard?
Thanks in advance fro your help!
<? include("config.php")?>
<?
$sql = "insert into tbluser (
yourName,
yourEmail,
yourFName,
friendsEmail,
yourMessage,
yourScore,
post_date
) values ('".
$POST['yourName']."','".
$POST['yourEmail']."','".
$POST['yourFName']."','".
$POST['friendsEmail']."','".
$POST['yourMessage']."','".
$POST['yourScore']."','".
date('y-m-d',strtotime("now()"))."')";
//die($sql);
mysql_query($sql) or die("Error is ".mysql_error());
$id = mysql_insert_id();
if (isset($POST['yourEmail'])){
$HTML = "Dear ".$POST['yourFName'].",\n\n";
$HTML .= "Check out this cheeky little outfit designed by me exclusively for you!<br><br />Click on the following link to view the outfit.<br><br><a href='http://www.domainname.com/folder/game/viewDesign1.php?id=".$id."' target='blank'>http://www.domainname.com/folder/game/viewDesign1.php?id=".$id."</a>
<br><br>
".$POST['yourMessage']."
<br><br>Thanks,<br>".$_POST['yourName'];
$to = $_POST['friendsEmail'];
$sub = "Your friend (".$_POST['yourName'].") sent you an email.";
$headers = "MIME-Version: 1.0\r\n";
$headers = "Content-type: text/html; charset=iso-8859-1\r\n";
$headers = "Return-Path: [email]bounces@domain.com[/email]\r\n";
$headers = "bcc: [email]webmaster@domain.com[/email]\r\n";
$headers = "From: ".trim($_POST['yourName'])."<".trim($_POST['yourEmail']).">\r\n";
mail($to, $sub, $HTML, $headers);
}
?>