[mail function]
; For Win32 only.
; http://PHP.net/smtp
SMTP = smtp.qq.com
; http://PHP.net/smtp-port
smtp_port = 25
; For Win32 only.
; http://PHP.net/sendmail-from
sendmail_from = yourmail@qq.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
; http://PHP.net/sendmail-path
sendmail_path ="E:\aserver\sendmail\sendmail.exe -t "
mail.add_x_header = On
SMTP= smtp.qq.com 这里也可以配置成网易的163邮箱也可以
smtp_port = 25 默认即可
sendmail_from="yourmail@qq.com" 写上自己的邮箱地址
sendmail_path ="E:\aserver\sendmail\sendmail.exe -t" 写上自己的sendmail.exe 路径
mail.add_x_header = On 默认即可
2.设置sendmail.ini文件
[sendmail]
smtp_server=smtp.qq.com
; smtp port (normally 25)
smtp_port=25
smtp_ssl=auto
error_logfile=error.log
debug_logfile=debug.log
auth_username=yourmail@qq.com
auth_password=授权码
注意auth_password不是QQ密码,而是授权码
3.找到邮箱的设置
$to = "330435168@qq.com";
$subject = "盼图网";
$message = "<h1>登录验证码</h1>";
$from = "1029091536@qq.com";
$headers = "From: $from";
if(mail($to,$subject,$message,$headers)){
echo "发送成功";
}else{
echo "发送失败";
}
文章来源于本人个人博客 http://www.fdqiudapan.com/?id=7,感谢关注
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。