2012-11-12 47 views
-5

我無法通過codeigniter發送電子郵件。當我試圖使用呼應的echo $this->email->print_debugger();錯誤我得到了以下錯誤:無法使用codeigniter發送電子郵件

hello: 250-smtpout17-02.prod.mesa1.secureserver.net 
250-PIPELINING 
250 8BITMIME 

Failed to send AUTH LOGIN command. Error: 502 unimplemented (#5.5.1) 

from: 250 ok 

to: 553 sorry, relaying denied from your location [---] (#5.7.1) 

The following SMTP error was encountered: 553 sorry, relaying denied from your location [--] (#5.7.1) 

data: 503 RCPT first (#5.5.1) 

The following SMTP error was encountered: 503 RCPT first (#5.5.1) 
502 unimplemented (#5.5.1) 
The following SMTP error was encountered: 502 unimplemented (#5.5.1) 
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method. 

我無法找出issue.If你知道原因,請幫助。

+0

ü可以顯示哪些烏爾使用代碼..... –

回答

2

問題出在SMTP主機上。我提供了一個錯誤的smtp主機,這就是爲什麼它給了我這個錯誤。

+0

高調這和原來的問題,因爲這種方法解決了我的同樣的問題。有關更多詳情,請參閱我的答案。 – bwright

0

我想SMTP服務器不允許你從你的IP發送郵件。確保您使用的是正確的SMTP服務器。

3

嗨,這是我用於我的項目的代碼。我正在從Gmail發送郵件,以便根據您的服務器進行更改。

function sendMail() 
    { 
     $config = Array(
     'protocol' => 'smtp', 
     'smtp_host' => 'ssl://smtp.googlemail.com', 
     'smtp_port' => 465, 
     'smtp_user' => '[email protected]', // change it to yours 
     'smtp_pass' => 'xxx', // change it to yours 
     'mailtype' => 'html', 
     'charset' => 'iso-8859-1', 
     'wordwrap' => TRUE 
    ); 

      $message = ''; 
      $this->load->library('email', $config); 
      $this->email->set_newline("\r\n"); 
      $this->email->from('[email protected]'); // change it to yours 
      $this->email->to('[email protected]');// change it to yours 
      $this->email->subject('Resume from JobsBuddy for your Job posting'); 
      $this->email->message($message); 
      if($this->email->send()) 
     { 
      echo 'Email sent.'; 
     } 
     else 
     { 
     show_error($this->email->print_debugger()); 
     } 

    } 
+0

如果您認爲我的代碼可以幫助你,請考慮它是有用的....... –

0

我有這個相同的問題,由於幾個過時的GoDaddy教程,然後提供,然後確認一個不正確的主機地址。我發現在你遇到這個問題的時候你還在使用GoDaddy的電子郵件服務(secureserver.net)。對於其他人誰運行到這個問題,將更新的信息......

host = 'smtpout.secureserver.net' 

..是(目前)這裏詳細:link