①去网上可以发送邮件的应用程序,我是在windows系统下,找到了一个叫“sendmail.exe”的文件,下载时去官网下 ,里面不仅有exe执行程序,还有种种配置。
②配置:在 sendmail.ini文件中,我们以QQ邮箱为例。
smtp_server=smtp.qq.com
smtp_port=465
smtp_ssl=auto
error_logfile=error.log
auth_username=291522145(邮箱账号)
auth_password=saturday123456(邮箱 密码)
force_sender=291522145@qq.com
③配置php.ini:
[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP = smtp.qq.com
sendmail_from = 291522145@qq.com
sendmail_path ="i:\abc\sendmail\sendmail.exe -t"
mail.add_x_header = On
④php程序:
<?php ini_set('display_errors',0); error_reporting(-1); ini_set('log_errors',1); error_log('today ids rain',1,'291522145@qq.com');
所有配置好后,重启服务,然后运行php程序,就能 发现你的 qq邮箱里多了一封邮件。