在主題..!用xampp在本地發送電子郵件到gmail帳戶,沒有錯誤,但電子郵件沒有到達
我配置我的文件在php.ini
SMTP =smtp.gmail.com
smtp_port = 587
sendmail_from = my [email protected]
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上運行
謝謝。
本地您不允許聯繫gmail SMTP服務器。您只能訪問您自己的Internet提供商的SMTP服務器。 – RTB 2012-07-25 09:06:44
@RTB謝謝..然後,我想我會推遲測試,直到我將其上傳到服務器 – proG 2012-07-25 09:19:27