我是PHPMailer的新手。它在我的本地主機上運行良好,但不在現場。phpmailerException消息'無效的地址'
我得到這個錯誤:
Fatal error: Uncaught exception 'phpmailerException' with message 'Invalid address: ' in /directoryhere/test/public_html/scripts/phpmailer/class.phpmailer.php:498 Stack trace: #0 /directoryhere/test/public_html/scripts/phpmailer/class.phpmailer.php(438): PHPMailer->AddAnAddress('to', '', '') #1 /directoryhere/test/public_html/scripts/include.php(189): PHPMailer->AddAddress('', '') #2 /directoryhere/test/public_html/forgot.php(49): send_mail() #3 /directoryhere/test/public_html/index.php(141): include('/home1/test...') #4 {main} thrown in /directoryhere/test/public_html/scripts/phpmailer/class.phpmailer.php on line 498
這是代碼行
/directoryhere/test/public_html/scripts/phpmailer/class.phpmailer.php:498
:
if (!self::ValidateAddress($address)) {
$this->SetError($this->Lang('invalid_address').': '. $address);
if ($this->exceptions) {
throw new phpmailerException($this->Lang('invalid_address').': '.$address);
}
if ($this->SMTPDebug) {
echo $this->Lang('invalid_address').': '.$address;
}
return false;
}
/directoryhere/test/public_html/scripts/phpmailer/class.phpmailer.php(438)
:
public function AddAddress($address, $name = '') {
return $this->AddAnAddress('to', $address, $name);
}
任何人都可以幫助我這可能是什麼原因?
我需要一個新的郵件主機? –
該錯誤消息顯示您根本沒有傳送電子郵件地址,因此請檢查您的調用代碼,而不是PHPMailer。 – Synchro
嗯,你扔的地址是什麼**? – m02ph3u5