Jump to content


Photo

How to send HTML email?


  • Please log in to reply
1 reply to this topic

#1 dragonusthei

dragonusthei
  • Members
  • PipPipPip
  • Advanced Member
  • 46 posts

Posted 22 September 2006 - 07:55 PM

Hello,


How do i sent html emails through a PHP form?


When ever i add tags useing mail(); they are just recived as the tags in the message



#2 onlyican

onlyican
  • Members
  • PipPipPip
  • Advanced Member
  • 921 posts
  • LocationHants - UK

Posted 22 September 2006 - 07:58 PM

Its to do with the headers in the mail
<?php
$to = "me@example.com
$subject = "Test Mail";
$body = "<html>\n"
."<head>\n"
."<title>Test Mail</title>\n"
."</head>\n"
."<body>\n"
."This is an email<br />\n"
."</body>\n"
."</html>\n";

$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

mail($to, $subject, $body, $headers);
?>

Tell me the problem, I will try tell you the solution




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users