JakeSilver Posted June 16, 2008 Share Posted June 16, 2008 Hello I am trying to make a HTML email function for a simple contact management system. I am able to get the email to send easily. However the contents of the email does not appear as it should. i.e. The HTML is not being read by the email client. When the Enter key is it on the web pagethe email is still only displayed as one long line of text. even when including "<br>" the email does not drop a line! how can this be fixed? I have the following code for sending the email <? if ($_POST['Submit']){ $subject = strip_tags($_POST['subject']); $message = strip_tags($_POST['message']); $header="<img src='http://www.url.co.uk/emailheader.jpg'><br>"; $footer="<br><img src='http://www.urlco.uk/emailfooter.jpg'>"; $emailbody = $header.''.$message.''.$footer; if ((!$subject) || (!$message) ){ echo "Please fill in all the infomation"; }else{ $a=mysql_query("SELECT * FROM registered WHERE course_id='$id' ORDER BY id DESC"); while($f=mysql_fetch_object($a)){ $email = $f->email; mail($email, $subject, $emailbody, "From: ????<info@?????.co.uk>\n" . "MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1"); echo "email sent to $email<br>"; }}} I hope i have given enough detail for it to be fixed. Many thanks. Jake Link to comment https://forums.phpfreaks.com/topic/110405-user-created-html-email-urgent/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.