我用phpgmailer
發送電子郵件,它工作順利。今天,我測試了我的項目,現在不工作。phpgmailer突然停止工作
<?php
require_once('class.phpgmailer.php');
$mail = new PHPGMailer();
$mail->Username = '[email protected]';
$mail->Password = '********';
$mail->From = '[email protected]';
$mail->FromName = "<blah>";
$mail->Subject = 'something';
$mail->AddAddress('[email protected]');
$mail->Body = "Hello Sir"."\n"."
Your Password is : ."."";
$mail->Host = 'smtp.gmail.com';
$mail->Port = 465;
$mail->Send();
if(!$mail->Send())
{
echo 'Message could not be sent.' ;
echo 'Mailer Error: ' . $mail->ErrorInfo;
exit;
}
echo 'Message has been sent';
當你echo'$ mail-> ErrorInfo'時,你得到的錯誤是什麼? – Wasim
無法發送消息。郵件錯誤:以下發件地址失敗:[email protected] –
我一直在使用Google搜索這麼多個小時,但沒有任何幫助:( 非常沮喪, –