-1
我有一個在工作結束時發送電子郵件的腳本。在某些時候,停止發送帶有錯誤的消息:PHPMailer停止工作:無法實例化郵件功能
Could not instantiate mail function
沒有對腳本或系統設置進行任何更改。 唯一發生了變化的是隨着正在處理的數據量的增加,增加的內存消耗和執行時間。
可能與內存有關的錯誤?如果我在腳本的開頭嘗試發送消息,則一切正常。
編輯: 相同的代碼工作在腳本的開始,並在最後不起作用。
require_once 'class_phpmailer.php';
$phpmail = new PHPMailer();
$phpmail->CharSet = 'UTF-8';
$phpmail->Sender = "[email protected]";
$phpmail->From = "[email protected]";
$phpmail->FromName = "mysite";
$phpmail->AddAddress('[email protected]');
$phpmail->Subject = 'test';
$phpmail->MsgHTML('test');
if(!$phpmail->Send()){
echo $phpmail->ErrorInfo ;
}
這個問題已經被問[前](HTTP ://stackoverflow.com/questions/1944631/could-not-instantiate-mail-function-why-this-error-occuring),[here](http://stackoverflow.com/questions/1297084/phpmailer-error-不能實例化郵件功能?lq = 1)和[這裏](http://stackoverflow.com/questions/30648462/phpmailer-er ROR-能而不是實例化郵件功能?LQ = 1)。可能想檢出重複項。 – Qirel
我讀了所有的線程,錯誤是一樣的,但沒有類似於我的情況 – user451555
只是一個想法,你永遠不會知道:-)不要認爲這是一個內存問題,很可能你會得到一個特定的錯誤 - 在這種情況下的消息。也許分享你的代碼有助於解決問題。 @ user451555 – Qirel