1
我試圖用PEAR發送交易電子郵件。我的PHP代碼:PHP PEAR郵件致命錯誤
include('Mail.php');
include('Mail/mime.php');
$text = 'test text';
$html = '<html><body><b>HTML</b></body></html>';
$crlf = "\n";
$hdrs = array(
'From' => '***@***.com',
'Subject' => 'Test - PEAR mail'
);
$mime = new Mail_mime($crlf);
$mime->setTXTBody($text);
$mime->setHTMLBody($html);
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$mail = Mail::factory('smtp',
array ('host' => 'mail.***.com',
'auth' => true,
'username' => '***@***.com',
'password' => '***'));
$mail->send(***@***.com, $hdrs, $body);
結果:
「致命錯誤:調用未定義的方法PEAR :: RAISEERROR()在/home4/good7/php/Net/SMTP.php上線349」
我在SMTP.php看看行349:
return PEAR::raiseError('Invalid response code received from server', $this->code);
我假設的錯誤是在我的代碼,而不是在SMTP.php,但我不能找到它。
此網站是共享主機。
任何洞察讚賞。
感謝您指出我在正確的方向。原來是包含路徑的錯誤。 – blogo