PC Nerd Posted January 18, 2008 Share Posted January 18, 2008 Hi, Ive got an email feature on my website - and I need it to be HMTL. I know that my email host supports HTML emails, however whenever I send an email It appears as text. Its got this at the beginning of my HTML email: <html><head><meta http-equiv='Content-Type' content='text/html' /> Is this incorrect, or is there another method to making my email in HTML format? Thanks Quote Link to comment https://forums.phpfreaks.com/topic/86583-html-email-is-appearing-as-text/ Share on other sites More sharing options...
teng84 Posted January 18, 2008 Share Posted January 18, 2008 do you have this in your code $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; to tell the script that you're sending email Quote Link to comment https://forums.phpfreaks.com/topic/86583-html-email-is-appearing-as-text/#findComment-442387 Share on other sites More sharing options...
pocobueno1388 Posted January 18, 2008 Share Posted January 18, 2008 You need to use the header function. <?php $headers = "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; mail($to, $subject, $body, $headers); ?> Beat to it Quote Link to comment https://forums.phpfreaks.com/topic/86583-html-email-is-appearing-as-text/#findComment-442389 Share on other sites More sharing options...
PC Nerd Posted January 18, 2008 Author Share Posted January 18, 2008 Thankyou Quote Link to comment https://forums.phpfreaks.com/topic/86583-html-email-is-appearing-as-text/#findComment-442474 Share on other sites More sharing options...
rameshfaj Posted January 18, 2008 Share Posted January 18, 2008 Be aware different mail servers use different headers for sending the email,the single header may not work for all the mail servers. Quote Link to comment https://forums.phpfreaks.com/topic/86583-html-email-is-appearing-as-text/#findComment-442532 Share on other sites More sharing options...
PC Nerd Posted January 18, 2008 Author Share Posted January 18, 2008 Im finding that its not sending as HTML Im using google apps email to read the outgoing email, btu using another mailserver to send the email from. Is there another way to send as HTML - or another funciton the spacialises in HTML email sending? ( im using mail()) Thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/86583-html-email-is-appearing-as-text/#findComment-442568 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.