PHP configures SendMail under Windows to send mail via the mail () function

Source: Internet
Author: User
Tags mail account

The PHP mail () function is not available in Windows and requires the installation of SendMail.

1. Download Sendmail.zip from http://glob.com.au

2. Unzip the sendmail.zip into the directory ( preferably with a short path, long path will cause problems ), I installed the path is: C:\sendmail

3. Modify the php.ini configuration, I am using QQ mailbox to send mail. The configuration is as follows:

4. Modify Sendmail.ini, file path: C:\sendmail\sendmail.ini

Smtp_server=smtp.qq.comsmtp_port=25auth_username= own e-mail account auth_password= password force_sender= own e-mail account

The following two best open, easy to see there is a problem
; Log SMTP errors to Error.log (defaults to same directory as Sendmail.exe); Uncomment to enable Loggingerror_logfile=error.log; Create debug log as Debug.log (defaults to same directory as Sendmail.exe); Uncomment to enable Debuggingdebug_logfile=debug.log
5. Test the Send mail feature
<?phpheader ("Content-type:text/html;charset=utf-8"), if (Mail ("[email protected]", "Test", "Test Mail")) {//[email Protected] for recipient mailbox    echo "sent successfully!! ";} else{    echo "Send failed!! ";}? >


PHP configures SendMail under Windows to send mail via the mail () function

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.