我正在發送一些電子郵件,PHPMailer 在我的測驗服務器上運行良好。
現在,在我將它移動到生產服務器后,我的郵件都不會被觸發,我得到了一個
郵件程式錯誤:語言字串無法加載:實體化。
我一直在用 phpmailer 搜索和辛勤作業,看看似乎是什么問題,從我收集的資訊來看,我無法發出常規的 php mail() 請求(這是需要回傳 true 才能停止錯誤的 var .
我正在發送一些電子郵件,PHPMailer 在我的測驗服務器上運行良好。
try {
$mail->SMTPDebug = 0; // Enable verbose debug output
$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = $mail_user_name; // SMTP username
$mail->Password = $mail_user_password; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
$mail->Port = 587; // TCP port to connect to
//Recipients
$mail->setFrom($customerservice_email, $customerservice_name);
$mail->addAddress('[email protected]'); // reciever email address
// $mail->addAddress('[email protected]'); // Add a recipient
// $mail->addAddress($to);
$mail->SetLanguage('en');
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = $subject;
$mail->MsgHTML($message);
if($mail->send()){
return true;
}
return false;
}
catch (Exception $e) {
print_r($e);die;
return false;
}
有人有什么可以幫我解決的嗎?在這一點上,它變得非常沮喪。
uj5u.com熱心網友回復:
與往常一樣,閱讀檔案。從字面上看,它告訴您的第一件事是確保您運行的是最新版本,而您并沒有這樣做。多年前從 PHPMailer 中洗掉了“語言字串”錯誤訊息。升級,問題就會消失。
之后您可能仍然遇到問題,但無論是什么,它都可能包含在同一個故障排除指南中。
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/330280.html
上一篇:Java郵件應用程式
