Here is a piece from W3school about PHP mail function chestnut, after testing found two problems.
<?PHP$to= "[email protected], [email protected]";$subject= "HTML Email";$message= "";//When sending HTML e-mail, always set Content-type$headers= "mime-version:1.0". "\ r \ n";$headers. = "Content-type:text/html;charset=iso-8859-1". "\ r \ n";//More Headers$headers. = ' From: <[email protected]> '. "\ r \ n";$headers. = ' Cc: [email protected] '. "\ r \ n";Mail($to,$subject,$message,$headers);?>
The first is the coding problem. Test found Chinese garbled, changed to Utf-8 can
The second is the problem of carriage return, after testing that the headers information is not effective, but is output as is. After Google found the reason will return to Php_eol to change the line
// When sending HTML e-mail, always set Content-type $headers Php_eol ; $headers Php_eol ; // More Headers $headers Php_eol ; $headers Php_eol;
In fact, this problem occurs because Windows next-line and Linux inconsistencies caused by inconsistency, PHP has a built-in solution. That's it.
After you've configured the Postfix mail server, you're ready to use it to send mail.