project3 Posted May 12, 2008 Share Posted May 12, 2008 i have some code that wont send html mail. i got it from the online mail manual but yet when getting it in gmail it doesn't come as html mail. <?php // multiple recipients $to = '[email protected]'; // subject $subject = 'html test'; // message $message = ' <html> <head> <title>Birthday Reminders for August</title> </head> <body> <p>Here are the birthdays upcoming in August!</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"; // Mail it mail($to, $subject, $message, $headers); ?> Link to comment https://forums.phpfreaks.com/topic/105219-html-mail-not-html-in-gmail/ Share on other sites More sharing options...
The Little Guy Posted May 12, 2008 Share Posted May 12, 2008 try and add the additional headers: $headers .= 'To: Me <[email protected]>' . "\r\n"; $headers .= 'From: My Site <[email protected]>' . "\r\n"; Link to comment https://forums.phpfreaks.com/topic/105219-html-mail-not-html-in-gmail/#findComment-538775 Share on other sites More sharing options...
project3 Posted May 12, 2008 Author Share Posted May 12, 2008 try and add the additional headers: $headers .= 'To: Me <[email protected]>' . "\r\n"; $headers .= 'From: My Site <[email protected]>' . "\r\n"; actually i figured it out gmail didn't like the \r\n when i changed it to just the r that was fine. Link to comment https://forums.phpfreaks.com/topic/105219-html-mail-not-html-in-gmail/#findComment-538782 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.