note 35658 added to ref.mail

From: Date: Wed, 10 Sep 2003 05:35:31 +0000
Subject: note 35658 added to ref.mail
Groups: php.notes 
Request: Send a blank email to php-notes+get-55915@lists.php.net to get a copy of this message
If one uses header info containing Content-type: text/html, then you may have issues with new lines. If the user views in plain text, then <br> shows in the text. If one relies on \r\n then it will not work because of the html content type. Use a content type of text/plain instead. $header = "Content-type: text/plain; charset=iso-8859-1\r \n"; So my header info looks like: $headers = "MIME-Version: 1.0\r \n"; $headers .= "Content-type: text/plain; charset=iso-8859-1\r \n"; $headers .= "From: \"$myname\" <$myemail>\r \n"; $headers .= "Reply-To: \"$myname\" <$myemail>\r \n"; $headers .= "X-Priority: 3\r \n"; $headers .= "X-MSMail-Priority: High\r \n"; $headers .= "X-Mailer: Just My Server"; This gives good results from a linux server and email appears correctly in MS Outlook Express ans hotmail(particularly fussy w/ headers). Thus the $message newlines correctly too, instead of being run together if Content Type is text/html $message = "Thank you for your enrolment.\r\n"; $message .= "Your member name is $member_name.\r\n"; Brett ---- Manual Page -- http://www.php.net/manual/en/ref.mail.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35658 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35658&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35658&report=yes

« previous php.notes (#55915) next »