Jump to content

User Created HTML Email -URGENT-


JakeSilver

Recommended Posts

Hello ;D

 

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.