Home > Article > Backend Development > Detailed explanation of how PHP configures sendmail under windows and sends emails through the mail() function
This article mainly introduces the method of configuring sendmail under Windows using PHP and sending emails through the mail() function. It analyzes the configuration steps and corresponding usage skills of sendmail on the Windows platform in more detail. Friends in need can refer to the following
1. The php mail() function cannot be used in windows, and sendmail needs to be installed.
2. Download the sendmail component from http://glob.com.au/sendmail/
3. Unzip sendmail.zip to the directory. The path I installed is: F :\root\sendMail
4. Configure php.ini, mainly configure the following three items
5. Modify sendmail.ini, file path: F: \root\sendMail\sendmail.ini
smtp_server=smtp.qq.com smtp_port=25 auth_username=yourusername auth_password=yourpassword force_sender=******@qq.com
6. Test sending mail
<?php if(mail("test@test.com","测试","测试邮件")){ echo "success"; } else { echo "fail"; }
phpstudy uses the built-in sendmail extension to send emails
sendai iis The sendmail configuration method of the php mail function is officially recommended
The above is the detailed content of Detailed explanation of how PHP configures sendmail under windows and sends emails through the mail() function. For more information, please follow other related articles on the PHP Chinese website!