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