Hello RC members,
I've set up a html mail that is send from an online emailform. Everything works fine when it is received in hotmail and gmail. Only when I open the message from the inbox in RC its displayed as text and doesnt has a HTML file...
The "show html" button is on and if I forward the hotmail mail to RC THEN it shows that it is an html message.
Can you review the .php mail code, so I can hopefully receive the mail as html in RC.
Thank you in advance!
CODE:
<?PHP
global $_POST;
$naam = $_POST["naam"] ;
$email = $_POST["email"];
$to = "mail@...";
$subject = "Title of the mail";
$mailheader = "From: ".$_POST["email"]."\r\n";
$mailheader .= "Reply-To: ".$_POST["email"]."\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
$message = "<html>
<head>
</head>
<body>
<table width='450' border='0' cellspacing='2' cellpadding='8'>
<tr>
<td width='98' bgcolor='#006699'><strong><font color='#FFFFFF' size='2' face='Verdana, Arial, Helvetica, sans-serif'>Naam:</font></strong></td>
<td colspan='4' bgcolor='#F2F2F2'>$naam</td>
</tr>
<tr>
<td width='98' bgcolor='#006699'><strong><font color='#FFFFFF' size='2' face='Verdana, Arial, Helvetica, sans-serif'>Email:</font></strong></td>
<td colspan='4' bgcolor='#F2F2F2'>$email</td>
</tr>
</table>
</body>
</html>";
header("Location: http://www....succes message");
mail($to,$subject,$message,$mailheader,"MIME-Version: 1.0\n" .
"Content-type: text/html; charset=iso-8859-1");
?>
Your code as a couple of problem, one of the main ones is your redirecting the user before the mail is sent. I cleaned up the code and its working for me.
$naam = $_POST["naam"];
$email = $_POST["email"];
$to = "mail@...";
$subject = "Title of the mail";
$mailheader = "From: ". $email ."\r\n";
$mailheader .= "Reply-To: ". $email ."\r\n";
$mailheader .= "MIME-Version: 1.0\r\n";
$mailheader .= "Content-type: text/html; charset=iso-8859-1\r\n";
$message = "
";
mail($to,$subject,$message,$mailheader);
header("Location: http://www....succes message");
?>
Thank you so much for the quick help. Looks much better & works much better ;)
Thanks again!