如主题..!
我配置我的文件如下
在 php.ini 中
SMTP =smtp.gmail.com
smtp_port = 587
sendmail_from = my adress@gmail.com
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
在 sendmail.ini 中
smtp_server=smtp.gmail.com
smtp_port=587
smtp_ssl=tls
auth_username=(my adress @gmail.com)
auth_password=( here my gamil account password )
要清楚你可以在这里看到我的 php 代码!
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1"."\r\n";
$headers .="From: my adress @gmail.com"."\r\n";
$subject = "Your New Password";
$message = "Your new password is as follows:
----------------------------
Password: $emailpassword
----------------------------
Please make note this information has been encrypted into our database
This email was automatically generated.";
if(!mail($forgotpassword, $subject, $message, $headers)){
die ("Sending Email Failed, Please Contact Site Admin! ($site_email)");
}else{
print'New Password Sent!.';
}
我发送时得到的是新密码已发送!。
没有错误,就像它真的已经发送但是当我检查电子邮件时没有消息!
注意:我在 windows-7 上运行
谢谢你。