B
boboinks
Guest
I'm trying to send an html mail using php but the problem is the recipient doesn't receive the html formatted mail.
for example I typed <center>Hello!</center> the email will look only as:
Hello!
not on he middle of the page which it should be. the only thing that works is the BOLD and ITALICIZE, the rest as if nothing happens.
here's my code:
$to = $_POST["to"];
$subject = $_POST["subject"];
$contents = $_POST["contents"];
$name = $_POST["name"];
$email = $_POST["email"];
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: ' . $name . ' <' . $email . ">\r\n" . 'Reply-To: ' . $email . "\r\n";
mail($to , $subject, $contents, $headers);
I already tried changing the $contents to
$contents = '<html>$_POST["contents"]</html>'
but still it doesnt work, instead it sends the phrase $_POST["contents"] to the email.
what should I do or change? I badly need your help.
for example I typed <center>Hello!</center> the email will look only as:
Hello!
not on he middle of the page which it should be. the only thing that works is the BOLD and ITALICIZE, the rest as if nothing happens.
here's my code:
$to = $_POST["to"];
$subject = $_POST["subject"];
$contents = $_POST["contents"];
$name = $_POST["name"];
$email = $_POST["email"];
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: ' . $name . ' <' . $email . ">\r\n" . 'Reply-To: ' . $email . "\r\n";
mail($to , $subject, $contents, $headers);
I already tried changing the $contents to
$contents = '<html>$_POST["contents"]</html>'
but still it doesnt work, instead it sends the phrase $_POST["contents"] to the email.
what should I do or change? I badly need your help.