note 106157 deleted from function.mail by cmb

From: Date: Sun, 21 Jul 2019 08:28:50 +0000
Subject: note 106157 deleted from function.mail by cmb
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-211635@lists.php.net to get a copy of this message
Note Submitter: saganwebdesign ---- If you are getting frustrated that your email is being sent as plain text instead of HTML, typically one of your headers showing up in the email (even if other scripts on the same server seem to work fine!!!) then structure your headers like this: <?php $headers = 'From: You <you@example.com>' . "\n"; $headers .= 'MIME-Version: 1.0' . "\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; ?> Notice that the From is before the MIME and Content and only Content ends with "\r\n", the other are just "\n" Not sure how it is possible for other scripts on the same server, same domain to work fine as shown in the very top instructions, and others need this crap... I spent a very frustrating couple hours figuring this out, hope you can avoid doing the same.

« previous php.notes (#211635) next »