1.配置php.ini
SMTP=smtp.163.com
sendmail_from = [email protected]
sendmail_path = "C:/xampp/sendmail/sendmail.exe -t"
2.配置sendmail.ini
smtp_server=smtp.163.com
[email protected]
auth_password=sqm100
[email protected]
3.测试
<?php
if (mail("[email protected]", "测试", "测试邮件")) {
echo ‘success!‘;
} else {
echo ‘fail‘;
}
时间: 2024-10-12 12:50:54