Codeigniter不通过JangoSMTP发送

时间:2011-05-05 19:16:49

标签: codeigniter smtp

我正在尝试使用codeigniter通过JangoSMTP发送电子邮件,无论出于何种原因,脚本大约需要60-70秒,然后在流程的最后一部分发送错误,即发送。

这是CI的调试..

*220 relay.jangosmtp.net ESMTP Welcome to the JangoSMTP trackable email relay system.; Thu, 05 May 2011 19:08:15 -0000

hello: 250-relay.jangosmtp.net Hello netdesk.aiwebsystems.com [173.236.184.252], pleased to meet you.

250-ENHANCEDSTATUSCODES

250-SIZE

250-EXPN

250-ETRN

250-ATRN

250-DSN

250-CHECKPOINT

250-8BITMIME

250-AUTH CRAM-MD5 PLAIN LOGIN DIGEST-MD5

250-STARTTLS

250 HELP

from: 250 2.1.0 ... Sender ok

to: 250 2.1.5 ... Recipient ok; will forward

to: 250 2.1.5 ... Recipient ok; will forward

data: 354 Enter mail, end with "." on a line by itself

The following SMTP error was encountered: 

Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.

User-Agent: CodeIgniter

Date: Thu, 5 May 2011 14:08:16 -0500

From: "Ryan Thompson" 

Return-Path: 

To: service@aiwebsystems.com

Subject: =?utf-8?Q?Email_Test_SMTP?=

Reply-To: "service@aiwebsystems.com" 

X-Sender: service@aiwebsystems.com

X-Mailer: CodeIgniter

X-Priority: 3 (Normal)

Message-ID: <4dc2f5a0b3518@aiwebsystems.com>

Mime-Version: 1.0

Content-Type: text/plain; charset=utf-8

Content-Transfer-Encoding: 8bit

Testing the email class.*

以下是我用来在沙箱控制器中发送的简单代码..

   function smtp(){
        $this->load->library('email');

        $config['protocol'] = 'smtp';
        $config['smtp_host'] = 'relay.jangosmtp.net';
        $config['smtp_user'] = 'MYUSERNAME';
        $config['smtp_pass'] = 'MYPASS';

        $this->email->initialize($config);

        $this->email->from('myemail@aiwebsystems.com', 'Ryan Thompson');
        $this->email->to('myemail@aiwebsystems.com'); 

        $this->email->subject('Email Test SMTP');
        $this->email->message('Testing the email class.');  

        $this->email->send();

        echo $this->email->print_debugger();
    }

我使用我的常规电子邮件主机和信用卡测试了这个完全相同的东西,它完美地弹出了一个。

我没有任何IP限制或来自:Jango的限制。我只是作为用户名/通行证进行身份验证。

我的CI版本是2.0.0

我的智慧结束了!!我的Email.php类文件未经编辑。

1 个答案:

答案 0 :(得分:1)

请参阅here

问题可能是由于CodeIgniter默认使用LF作为行终止符,而不是RFC要求的CRLF。添加以下代码:

$this->config['crlf'] = '\r\n';
$this->config['newline'] = '\r\n';