After you've configured the Postfix mail server, you're ready to use it to send mail.

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.