physaux Posted February 2, 2010 Share Posted February 2, 2010 Here is the code I based my email on. It is going to be set to a daily cron to send me updates. I have a whole variable of information, called $output, which, when I ECHO, comes out nice on my page. I now tried to send that value in an email, however it appears in my email not "formatted", but I see all the raw html code. $to = '[email protected]'; $subject = 'the subject'; $message = $output; $headers = 'From: [email protected]' . "\r\n" . 'Reply-To: [email protected]'; mail($to, $subject, $message, $headers); Does anyone know if it is possible for me to get the output I want? Link to comment https://forums.phpfreaks.com/topic/190702-html-formatted-text-sent-by-mail-showing-html-source-code-not-rendered/ Share on other sites More sharing options...
akitchin Posted February 2, 2010 Share Posted February 2, 2010 you must add the content type to your e-mail header, so that the e-mail client recognizes your text as HTML. here is an explanation of how to do that. Link to comment https://forums.phpfreaks.com/topic/190702-html-formatted-text-sent-by-mail-showing-html-source-code-not-rendered/#findComment-1005690 Share on other sites More sharing options...
physaux Posted February 2, 2010 Author Share Posted February 2, 2010 ah ok that worked perfectly thanks Link to comment https://forums.phpfreaks.com/topic/190702-html-formatted-text-sent-by-mail-showing-html-source-code-not-rendered/#findComment-1005710 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.