lional Posted June 12, 2007 Share Posted June 12, 2007 Hi All I am trying to send emails from my script but when I send the mail, my html tags show. An I doing something wrong I have included my code below // Recipients. You can send it to more than 1 person! $to = $email_out . ", " ; // note the comma $to .= $pur_email_out; // This is the email subject $my_subject = "Payment Confirmation"; // Message $my_message = <<<PAYMAIL <html> <head> <title>Payment Confirmation</title> </head> <body> <table> <tr> <td>Reference No.:</td><td>$reference</td> </tr> <tr> <td>Payment:</td><td>$payment_out</td> </tr> <tr> <td>Chapter:</td><td>$chapter_out</td> </tr> <tr> <td>Name:</td><td>$name_out</td> </tr> <tr> <td>Telephone:</td><td>$telephone_out</td> </tr> <tr> <td>Email Address:</td><td>$email_out</td> </tr> <tr> <td>Total:</td><td>$total_out</td> </tr> <tr> <td>Order Date:</td><td>$order_date_out</td> </tr> <tr> <td>Paid:</td><td>$paid_final</td> </tr> </table> </body> </html> PAYMAIL; // To send HTML mail, you can set the Content-type header. $my_headers = "MIME-Version: 1.0\r\n"; $my_headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; // Setting additional headers $my_headers .= $email_out; // And now mail it! mail($to, $my_subject, $my_message, $my_headers); Thanks Lional Link to comment https://forums.phpfreaks.com/topic/55233-html-mail/ Share on other sites More sharing options...
chocopi Posted June 12, 2007 Share Posted June 12, 2007 i dont usually use headers, but try replaceing text/html with text/plain Link to comment https://forums.phpfreaks.com/topic/55233-html-mail/#findComment-272999 Share on other sites More sharing options...
lional Posted June 12, 2007 Author Share Posted June 12, 2007 I have changed the header type, and even removed the headers but my mail still shows the html tags, Thanks Lional Link to comment https://forums.phpfreaks.com/topic/55233-html-mail/#findComment-273004 Share on other sites More sharing options...
lional Posted June 12, 2007 Author Share Posted June 12, 2007 I am still battling with my html mail. What confuses me is that if I print out the variable $my_message through php, it prints correctly but through my mail client, which is microsoft outlook, it prints the tags as well Any suggestions Thanks Lional Link to comment https://forums.phpfreaks.com/topic/55233-html-mail/#findComment-273099 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.