EllisLab text mark
Advanced Search
     
Email over SMTP is sent, but CI returns false
Posted: 31 October 2007 07:12 AM   [ Ignore ]
Joined: 2007-06-27
3 posts

Hi people,
CI is a wonderful thing, I switched from CakePHP and I like the way CI does not stand in my way and yet it serves me with many useful classes.

However, I have a weird problem with sending e-mail over SMTP. The email is sent, but CI’s send() method returns FALSE. The first problem is, that it shows SMTP’s 220 Service ready response as an error (with “The following SMTP error was encountered” before it). And the second problem is “354 Enter mail, end with “.” on a line by itself”. Is this some kind of incompatibility between CI’s mail class and some mailservers’ specific configs? (ESMTP Sendmail 8.13.6/8.13.6.)

Message sent was:

User-AgentCodeIgniter
Date
Wed31 Oct 2007 11:08:45 +0100
From
"dan" 
Return-Path
Toemail.address@server.com
Subject
Test mail
Reply
-To"qqww@post.cz" 
X-Senderqqww@post.cz
X
-MailerCodeIgniter
X
-Priority(Normal)
Message-ID: <4728542de4512@post.cz>
Mime-Version1.0


Content
-Typetext/plaincharset=utf-8
Content
-Transfer-Encoding8bit

Testing 

(the real address was exchanged for “email.address@server.com” so that crawlers don’t find it here)

 
Posted: 31 October 2007 07:17 AM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2007-06-27
3 posts

I’ve probably posted this to a wrong section, sorry. Some admin, please move this to the right section… Thanks.

 
Posted: 31 October 2007 08:52 AM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2007-06-27
3 posts

I’re reviewed CI’s email class and found out that it is very fragile as regards SMTP error codes. The only SMTP code it accepts is 250, however there are much more codes that don’t signalize error, see http://tools.ietf.org/html/rfc2821#section-4.2.2 (220, 354 etc.)

I’ve fixed the class on my local installation and filed a bug: http://codeigniter.com/bug_tracker/bug/2967/