cody7 Posted July 23, 2006 Share Posted July 23, 2006 Hi i'm having problem sending an HTML code in emails here is my code[code]$message = "<html><head><title>My Title</title></head><body>The Body</body></html>";$message = htmlentities($message);// my line of code that send this message on my yahoo email[/code]when i check my email heres what i see<html><head><title>My Title</title></head> in case you don't notice the text starting from the <body> tag is gonecan anyone help me with this, i just want to see the exact html code treated as text in my email like this:<html><head><title>My Title</title></head><body>The Body</body></html>Thanks for any help you can give me Quote Link to comment https://forums.phpfreaks.com/topic/15399-html-as-text-in-email/ Share on other sites More sharing options...
avo Posted July 23, 2006 Share Posted July 23, 2006 Hi mod and studdy this code i written this for one of my web sites i have taken my web address out [code] //Email $to = $customer_email ; $from = "from-email-address"; $subject = "Password Reminder"; //begin of HTML message $message = <<<EOF<html> <style type="text/css"><!--.style2 {color: #FF0000}.style4 {color: #6AA4B2}.style6 {color: #FCAD00}.style10 {font-size: 18px; color: #0000FF; }.style11 {font-family: Tahoma}--> </style> <body bgcolor="#DCEEFC"><center> <br> <br/> <div align="center" class="style11"><strong>Password Reminder For<span class="style10"> $realname</span></strong></div></center> <p> <left> </left> </p> <table width="800" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#00CCCC"> <tr> <td height="285" scope="col"><left><strong> </strong></left> <div align="left"> <p><span class="style11"><strong> Hello </strong></span><span class="style10"><strong>$realname</strong></span><span class="style11"><strong><br> This is your password Reminder From <span class="style4">Team</span><span class="style6">Console</span>.<br/> Please find your password bellow.<br/><br> You have received this e-mail because you requested a password reminder<br> If you did not request this reminder please e-mail<br/><br> Please click <a href="http://page-toclick-non"></a> and login to your account.<br><br/> Your Username Is <span class="style2">$user_name</span><br> Your Password Is <span class="style2">$frg_password<br/> </span><br> Please keep your password safe and secure.<br> Please remember your password is cAsE sEnSiTiVe.<br/> <br> This E-mail address is not monitored. Please Do Not reply!<br> <br> </strong></span></p> </div></td> </tr> </table> <p align="center"> <a href="http://page-toclick-non" class="style11"></a> </p> </body></html>EOF; //end of message $headers = "From: $from\r\n"; $headers .= "Content-type: text/html\r\n"; //options to send to cc+bcc //$headers .= "Cc: [email]maa@p-i-s.cXom[/email]"; //$headers .= "Bcc: [email]email@maaking.cXom[/email]"; // now lets send the email. mail($to, $subject, $message, $headers);[/code]hope it helps Quote Link to comment https://forums.phpfreaks.com/topic/15399-html-as-text-in-email/#findComment-62417 Share on other sites More sharing options...
cody7 Posted July 23, 2006 Author Share Posted July 23, 2006 i got it! i just useContent-type: text/plaininstead of Content-type: text/htmlanyway thank you for posting your help avo. Quote Link to comment https://forums.phpfreaks.com/topic/15399-html-as-text-in-email/#findComment-62421 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.