Codeigniter not sending through JangoSMTP
I am trying to send an email using codeigniter through JangoSMTP and for whatever reason the script takes about 60-70 seconds then gives me an error on the last portion of the process, the send.
Here is CI's debug..
*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.*
Here is the simple code I am using to send in a sandbox controller..
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->开发者_JAVA技巧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();
}
I tested this exact same thing with my regular email host and creds and it popped one off perfectly.
I don't have any IP restrictions or From: restrictions at Jango. I am authing only as username/pass.
My CI Version is 2.0.0
I am at the end of my wits!! My Email.php class file is un-edited.
See here
The problem is likely due to the fact that CodeIgniter defaults to using LF as the line terminator, rather than CRLF required by RFC. Add this code:
$this->config['crlf'] = '\r\n';
$this->config['newline'] = '\r\n';
精彩评论