2011-05-05 54 views
0

我想通過JangoSMTP使用codeigniter發送一封電子郵件,無論出於何種原因,腳本需要大約60-70秒,然後在過程的最後部分發送給我一個錯誤。Codeigniter不通過JangoSMTP發送

這裏是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: [email protected] 

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

Reply-To: "[email protected]" 

X-Sender: [email protected] 

X-Mailer: CodeIgniter 

X-Priority: 3 (Normal) 

Message-ID: <[email protected]> 

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('[email protected]', 'Ryan Thompson'); 
     $this->email->to('[email protected]'); 

     $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

參見here

的問題是可能是由於該笨默認使用LF作爲行終止,而不是CRLF要求RFC的事實。添加以下代碼:

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

喜@DeanGoodman,我加這兩條線來我的配置,但我仍然得到一個錯誤,當我發送到我的Gmail'錯誤:電子郵件地址不verified.'。它只在發送到我發送消息的同一個域時纔有效。對此有何想法?謝謝 – 2012-07-13 05:08:05