problem sending php mail
I am using simple mail() function to send mails, and everything works fine tile I supply a header info, as shown below:
$headers = "MIME-Version: 1.0\r\n";
$headers.= "Content-type: text/html; carset=iso-8859-1;\r\n";
$headers.= "From: TE开发者_StackOverflow中文版STSITE <".$mailfrom.">\r\n";
Also, on another note, my cpanel server doesn't show the msg log, so I can't exactly figure out why the mail failed. But for one thing, I am quite sure the problem is due to the inclusion of the header, any ideas what could be wrong and how to debug?
You have a mistake: carset=iso-8859-1
shuld be charset=iso-8859-1
.
Also due to PHP - mail() manual : " If messages are not received, try using a LF (\n) only instead of CRLF (\r\n). Some poor quality Unix mail transfer agents replace LF by CRLF automatically (which leads to doubling CR if CRLF is used). This should be a last resort, as it does not comply with » RFC 2822."
Well, without any tests, I can tell you that your 2.º line has a mistype:
Content-type: text/html; carset=iso-8859-1
should be:
Content-type: text/html; charset=iso-8859-1
精彩评论