① Looking for an application that can send emails online, I found a file called "sendmail.exe" under the Windows system. When downloading, go to the official website. It not only contains the exe execution program, but also various configurations.
②Configuration: In the sendmail.ini file, we take QQ mailbox as an example.
smtp_server=smtp.qq.com
smtp_port=465
smtp_ssl=auto
error_logfile=error.log
auth_username=29152 2145(email account)
auth_password=saturday123456(email password)
force_sender=291522145@qq.com
③Configure php.ini:
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = smtp.qq.com
sendmail_from = 291522145@qq.com
sendmail_path = "i :abcsendmailsendmail.exe -t"
mail.add_x_header = On
④php program:
<span><?php </span><span><em>ini_set</em></span>(<span>'display_errors'</span>,<span>0</span>); <span><em>error_reporting</em></span>(<span>-</span><span>1</span>); <span><em>ini_set</em></span>(<span>'log_errors'</span>,<span>1</span>); <span><em>error_log</em></span>(<span>'today ids rain'</span>,<span>1</span>,<span>'291522145@qq.com'</span>);
After everything is configured, restart the service, and then run the php program, you can find your qq mailbox There is an extra email.
The above introduces the error log email sent by php, including php and error content. I hope it will be helpful to friends who are interested in PHP tutorials.