function send_mail($myname, $myemail, $contactname, $contactemail,$subject, $message){ $headers =""; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-type: text/html;\n\tcharset=\"iso-8859-1\"\n"; $headers .= "X-Priority: 3\n"; $headers .= "X-MSMail-Priority: Normal\n"; $headers .= "X-Mailer: MyMailer\n"; $headers .= "To: \"$contactname\" <$contactemail>\n"; $headers .= "From: \"$myname\" <$myemail>\n"; $headers .= "Reply-To: \"$myname\" <$myemail>\n"; return( mail( $contactemail, $subject, urldecode($message), $headers ) ); } PHP: I am using this simple email functions from years without any errors. From last month I am receiving complaints from customers that their order receipts are junk html code ("<td>order no 15"</td>"....) and they can't view order receipts. I did not notice any problem as I am getting copy of order receipts at yahoo without any error (HTML formatted). Please comment how to fix it?
Try replacing your "\n" line endings with "\r\n" to make them compatible with most, if not all, mail servers. Jay
One customer replied that problem is in outlook. Online web based emails are perfect. Thanks DarkMindZ and Jay. I will try both of your suggestions. Rep added.
That doesn't mean it doesn't work. That means you are probably sending spam (or something that is being perceived as unsolicited commercial email)
Show me the full script please. plus, did you change the server that you are sending from? or any mail settings? that can affect it too.
Check with your customer he/she may have enabled text view in outlook, HTML will not show up if this is the case
Check with your customer he/she may have enabled text view in outlook, HTML will not show up if this is the case
the problem is the urldecode function that breaks the html-markup stored in the $message variable it could be a worm, get your machine checked just to be sure. if you use a yy/mm/dd style date in the message it is 'escaped' as yy%eemm%eedd. in the final 'mail' command you use urldecode and the sequence is interpreted incorrectly into some other sign, maybe ' or " and then you get open strings in the html-source and the thing is dumped as raw text.