kat32 Posted April 5, 2009 Share Posted April 5, 2009 <?php include('config.php'); $query = mysql_query("SELECT topics.topictitle, users.email FROM topics LEFT JOIN users ON topics.userid=users.userid WHERE topics.topicid=1") or die(mysql_error()); $row = mysql_fetch_array($query); $Name = "kat"; $sender_email = "[email protected]"; $topictitle=$row['topictitle']; $email=$row['email']; $header = "From: ". $Name . " <" . $sender_email . ">\r\n"; $header =. "Content-type: text/html; charset=iso-8859-1\r\n"; $subject = "this is the subject"; $qry = mysql_query("SELECT emailmsg FROM emails WHERE emailmsgid=1") or die(mysql_error()); $row = mysql_fetch_array($qry); $body=$row['emailmsg']; $sent = mail($email, $subject, $body, $header); if($sent){ echo 'sent'; } ?> I have entered html tags <b>this is the body</b><br> <i>more text here</i>, etc. in the body using phpmyadmin. the problem is when I send it to my email, I can see the tags. it should be this is the body more text here Please help, thanks in advance. Link to comment https://forums.phpfreaks.com/topic/152702-solved-html-email/ Share on other sites More sharing options...
vbnullchar Posted April 6, 2009 Share Posted April 6, 2009 this line $header =. "Content-type: text/html; charset=iso-8859-1\r\n"; should be $header .= "Content-type: text/html; charset=iso-8859-1\r\n"; Link to comment https://forums.phpfreaks.com/topic/152702-solved-html-email/#findComment-801918 Share on other sites More sharing options...
kat32 Posted April 6, 2009 Author Share Posted April 6, 2009 this line $header =. "Content-type: text/html; charset=iso-8859-1\r\n"; should be $header .= "Content-type: text/html; charset=iso-8859-1\r\n"; still I can see the tags in my email Link to comment https://forums.phpfreaks.com/topic/152702-solved-html-email/#findComment-801950 Share on other sites More sharing options...
vbnullchar Posted April 6, 2009 Share Posted April 6, 2009 try the code below.. this is from http://www.php.net/function.mail <?php // multiple recipients $to = '[email protected]' . ', '; // note the comma $to .= '[email protected]'; // subject $subject = 'Birthday Reminders for August'; // message $message = ' <html> <head> <title>Birthday Reminders for August</title> </head> <body> <p><b>Here are the birthdays upcoming in August!</b></p> </body> </html> '; // 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' . "\r\n"; // Additional headers $headers .= 'To: Mary <[email protected]>, Kelly <[email protected]>' . "\r\n"; $headers .= 'From: Birthday Reminder <[email protected]>' . "\r\n"; $headers .= 'Cc: [email protected]' . "\r\n"; $headers .= 'Bcc: [email protected]' . "\r\n"; // Mail it mail($to, $subject, $message, $headers); ?> Link to comment https://forums.phpfreaks.com/topic/152702-solved-html-email/#findComment-801963 Share on other sites More sharing options...
kat32 Posted April 6, 2009 Author Share Posted April 6, 2009 thank you Link to comment https://forums.phpfreaks.com/topic/152702-solved-html-email/#findComment-802072 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.