php mail sendmail
1.下载附件 sendmail.zip 本地装邮件服务器
-解压到任意路径,修改sendmail.ini,根据实际需要修改下面的信息。
[sendmail] smtp_server=smtp.qq.com smtp_port=25 error_logfile=error.log debug_logfile=debug.log auth_username=***@qq.com auth_password=*** //qq可能需要授权验证码 force_sender=***@qq.com
php.ini
SMTP = smtp.qq.com smtp_port = 25 sendmail_from = ***@qq.com sendmail_path = "D:/sendmail/sendmail.exe -t -i" mail.add_x_header = On
2. mail($to, $subject, $message, $headers, $parameters)
$to = "15****Hello email"; $message = "测试"; // 更多报头 $headers = 'From: 1****@qq.com'; var_dump(mail($to,$subject,$message,$headers));