teebo Posted April 11, 2007 Share Posted April 11, 2007 Hi, I have just signed up to a Virtual Server and I'm having issues with sending email via mail() in HTML format. I have a simple script to test the server and it's not working correctly. The receiving server does not understand it's an HTML email. On another server, this script works perfectly: $to = "[email protected]"; $subject = "HTML email"; $message = " <html> <head> <title>HTML email</title> </head> <body> <p>This email contains HTML Tags!</p> <table> <tr> <th>Firstname</th> <th>Lastname</th> </tr> <tr> <td>John</td> <td>Doe</td> </tr> </table> </body> </html> "; // Always set content-type when sending HTML email $headers = 'From: <[email protected]>' . "\r\n"; $headers .= "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=utf-8" . "\r\n"; // More headers mail($to,$subject,$message,$headers); Link to comment https://forums.phpfreaks.com/topic/46650-mail-html-email-not-working/ Share on other sites More sharing options...
TEENFRONT Posted April 11, 2007 Share Posted April 11, 2007 Whats the actuall issue? Does the server not send the email? Or do you mean when someone reads it, it doesnt treat it as html? if its the latter, i take it the recipient has a html enabled email browser? Sometimes hotmail etc doesnt allow html in emails so therefore will display as a standard text mail. Link to comment https://forums.phpfreaks.com/topic/46650-mail-html-email-not-working/#findComment-227248 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.