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 = "kat32@yahoo.com"; $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. Quote Link to comment 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"; Quote Link to comment 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 Quote Link to comment 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 = 'aidan@example.com' . ', '; // note the comma $to .= 'wez@example.com'; // 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 <mary@example.com>, Kelly <kelly@example.com>' . "\r\n"; $headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n"; $headers .= 'Cc: birthdayarchive@example.com' . "\r\n"; $headers .= 'Bcc: birthdaycheck@example.com' . "\r\n"; // Mail it mail($to, $subject, $message, $headers); ?> Quote Link to comment Share on other sites More sharing options...
kat32 Posted April 6, 2009 Author Share Posted April 6, 2009 thank you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.