wardo Posted January 15, 2007 Share Posted January 15, 2007 I have the following code which works fine apart from the format not coming through in HTML format. Can anyone see how I can make the email come through in html format?[code]$to = $_GET["email"];$subject = "Online booking";$message = stripslashes($message);$message = str_replace("\n","<p>",$message);$message = "<b>Booking Information:</b><p />Employee No:<br /><b>$eno</b> <p />Name:<br /> <b>$name</b><p />Title:<br /><b>$title</b><p />Base:<br /> <b>$base</b><p />Telephone No:<br /> <b>$tel</b><p />Course code and Date:<br /><b>$code</b><p />Title:<br /><b>$ctitle</b><p />";$from="From: [email protected]"; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\n";mail($to,$subject,$message,$from,$headers);echo "<p /><h4>Thank you. Your message has been sent.</h4>";[/code]Thanks for your help. Link to comment https://forums.phpfreaks.com/topic/34243-sending-mail-as-html-format/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.