-5

我无法通过 codeigniter 发送电子邮件。当我尝试使用echo $this->email->print_debugger();我来回显错误时,出现以下错误:

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.

我无法弄清楚问题。如果您知道原因,请提供帮助。

4

4 回答 4

3

嗨,我用于我的项目的这段代码。我是从 Gmail 发送的,因此请根据您的服务器进行更改。

function sendMail()
    {
        $config = Array(
      'protocol' => 'smtp',
      'smtp_host' => 'ssl://smtp.googlemail.com',
      'smtp_port' => 465,
      'smtp_user' => 'xxx@gmail.com', // 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('xxx@gmail.com'); // change it to yours
          $this->email->to('xxx@gmail.com');// 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());
        }

    }
于 2012-11-12T16:39:19.727 回答
2

问题出在 SMTP 主机上。我提供了一个错误的 smtp 主机,这就是它给我这个错误的原因。

于 2012-11-14T05:25:58.240 回答
0

我猜 SMTP 服务器不允许你从你的 IP 发送邮件。确保您使用的是正确的 SMTP 服务器。

于 2012-11-12T14:18:04.117 回答
0

由于几个过时的 GoDaddy 教程提供了然后确认不正确的主机地址,我遇到了同样的问题。我看到您在遇到此问题时也在使用 GoDaddy 的电子邮件服务 (secureserver.net)。对于遇到此问题的其他任何人,更新的信息...

host = 'smtpout.secureserver.net'

..(当前)在此处详细说明:链接

于 2014-02-07T20:16:56.093 回答