• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Email Not Sending (SMTP)

#1
[eluser]Popcorn[/eluser]
Hello Smile

Using ASmallOrange as hosts.

Code:
220-christian.asmallorange.com ESMTP Exim 4.69 #1 Mon, 25 Aug 2008 20:16:45 -0400 220-We do not authorize the use of this system to transport unsolicited, 220 and/or bulk e-mail.

hello: 250-christian.asmallorange.com Hello christian.asmallorange.com [64.22.96.74]
250-SIZE 52428800
250-PIPELINING
250-AUTH PLAIN LOGIN
250-STARTTLS
250 HELP

from: 250 OK

to: 550-christian.asmallorange.com (www.leveldesign.info) [64.22.96.74]:41462 is
550-currently not permitted to relay through this server. Perhaps you have not
550-logged into the pop/imap server in the last 30 minutes or do not have SMTP
550 Authentication turned on in your email client.

The following SMTP error was encountered: 550-christian.asmallorange.com (www.leveldesign.info) [64.22.96.74]:41462 is 550-currently not permitted to relay through this server. Perhaps you have not 550-logged into the pop/imap server in the last 30 minutes or do not have SMTP 550 Authentication turned on in your email client.

data: 503-All RCPT commands were rejected with this error:
503-christian.asmallorange.com (www.leveldesign.info) [64.22.96.74]:41462 is
503-currently not permitted to relay through this server. Perhaps you have not
503-logged into the pop/imap server in the last 30 minutes or do not have SMTP
503-Authentication turned on in your email client.
503 Valid RCPT command must precede DATA

The following SMTP error was encountered: 503-All RCPT commands were rejected with this error: 503-christian.asmallorange.com (www.leveldesign.info) [64.22.96.74]:41462 is 503-currently not permitted to relay through this server. Perhaps you have not 503-logged into the pop/imap server in the last 30 minutes or do not have SMTP 503-Authentication turned on in your email client. 503 Valid RCPT command must precede DATA
500 unrecognized command
The following SMTP error was encountered: 500 unrecognized command
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.

User-Agent: CodeIgniter
Date: Mon, 25 Aug 2008 20:16:45 -0400
From: "Mathew"
Return-Path:
To: [email protected]
Subject: http://www.favourbank.com/ Forgotten Password Request
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: multipart/alternative; boundary="B_ALT_48b34b6d982f5"
This is a multi-part message in MIME format.
Your email application may not support this format.

--B_ALT_48b34b6d982f5
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Forgotten Password Request
Your verification code is : *************
Please visit the verification page to proceed.


--B_ALT_48b34b6d982f5
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html&gt;
    &lt;head&gt;
    =00
    &lt;/head&gt;
    &lt;body&gt;
        <h2>Forgotten Password Request</h2>
        <p>Your verification code is : *******</=
p>
        <p>Please visit the <a >verification </a>page to proceed.</p>
    &lt;/body&gt;
&lt;/html&gt;

--B_ALT_48b34b6d982f5--

And using these smtp settings

Code:
$config['auth']['mail']['mailtype']        = 'html';
$config['auth']['mail']['protocol']     = 'smtp';
$config['auth']['mail']['smtp_host']     = 'mail.leveldesign.info';
$config['auth']['mail']['smtp_user']     = 'leveldes';
$config['auth']['mail']['smtp_pass']     = '**********';
$config['auth']['mail']['smtp_port']     = '26';

Any help is appreciated.

#2
[eluser]Peri[/eluser]
PopCorn,


I have same problem. Did you fix it?

#3
[eluser]Unknown[/eluser]
I was having the same problem with HostGator (by the way, very good hosting service in my opinion!)

Finally I found the _smtp_authenticate() function was not running because of a variable set to FALSE

system/libraries/Email.php file, line 60: var $_smtp_auth = TRUE;


I really hope this could be helpful to you.

Bye,
DAvide

#4
[eluser]Derek Jones[/eluser]
$_smtp_auth would be set to TRUE automatically if $this->smpt_user and $this->smtp_pass are set.

#5
[eluser]Unknown[/eluser]
You just need to initialize the email class in a different way. The documentation does not say this, but instead of:

Code:
$this->load->library('email');
$this->email->initialize($config);
you need to do:
Code:
$this->load->library('email', $config);

HTH,
Sorin

#6
[eluser]Derek Jones[/eluser]
You can do it either way, Sorin, the end result will be the same. Email::initialize() is what the constructor uses when you pass it while loading the library.

#7
[eluser]Mat-Moo[/eluser]
Looking at http://wiki.asmallorange.com/Email the username should be in the format [email protected] - try - [email protected] and see if it works.

Edit: Sorry didn't realise this was such an old thread!

#8
[eluser]webthink[/eluser]
Actually, I think sorinv is right, there is indeed a bug here.

One of our server's was just (yesterday) upgraded, and one of the patches closed an open relay SMTP issue.

Our codeigniter app could not send email.

Debugging, I found that the constructor of the email library was getting empty strings, instead of the smtp info set by config. Changing to $this->load->library('email', $config); solved the problem.

I don't really have time to look in detail, but I think the problem is that $_smtp_auth gets set to false when the library is loaded, and initialize doesn't change that.

EDIT: I can see that v1.7 fixes this, as it explicitly resets $this->_smtp_auth on line 129. So this bug is only for older versions of CodeIgniter.

To help people searching ... This was on a plesk server running qmail. The error was "553 sorry, that domain isn't in my list of allowed rcpthosts"

#9
[eluser]Derek Jones[/eluser]
Thanks webthink; it's always important when reporting bugs to be using the most up to date version of CI, or failing that, at least mentioning which version is in use, and I should have asked these users, but I bet that's the problem.

#10
[eluser]Spir[/eluser]
i'm using last CI version and I send mail using SMTP. I had an issue as well saying I have to check that page :
http://cr.yp.to/docs/smtplf.html

I notice my config wasn't setup. The default one was used.

Code:
&lt;?php
class TestMail extends Controller {
    
    
    function TestMail() {
        parent::Controller();
    }
    
    function index(){
        $config['useragent'] = 'test'; // The "user agent".
        $config['protocol'] = 'smtp'; // mail, sendmail, or smtp    The mail sending protocol.
        $config['mailpath'] = ''; // The server path to Sendmail.
        $config['smtp_host'] = 'myserver'; // SMTP Server Address.
        $config['smtp_user'] = ''; // SMTP Username.
        $config['smtp_pass'] = ''; // SMTP Password.
        $config['smtp_port'] = '25'; // SMTP Port.
        $config['smtp_timeout'] = '5'; // SMTP Timeout (in seconds).
        $config['wordwrap'] = TRUE; // TRUE or FALSE (boolean)    Enable word-wrap.
        $config['wrapchars'] = 76; // Character count to wrap at.
        $config['mailtype'] = 'html'; // text or html Type of mail. If you send HTML email you must send it as a complete web page. Make sure you don't have any relative links or relative image paths otherwise they will not work.
        $config['charset'] = 'utf-8'; // Character set (utf-8, iso-8859-1, etc.).
        $config['validate'] = FALSE; // TRUE or FALSE (boolean)    Whether to validate the email address.
        $config['priority'] = 3; // 1, 2, 3, 4, 5    Email Priority. 1 = highest. 5 = lowest. 3 = normal.
        $config['crlf'] = '\r\n'; // "\r\n" or "\n" or "\r" Newline character. (Use "\r\n" to comply with RFC 822).
        $config['newline'] = '\r\n'; // "\r\n" or "\n" or "\r"    Newline character. (Use "\r\n" to comply with RFC 822).
        $config['bcc_batch_mode'] = FALSE; // TRUE or FALSE (boolean)    Enable BCC Batch Mode.
        $config['bcc_batch_size'] = 200; // Number of emails in each BCC batch.

        $this->load->library('email');
        $this->email->initialize($config);

        $list = array('[email protected]', '[email protected]');


        $this->email->from('[email protected]', 'Me');
        $this->email->reply_to('[email protected]', 'Me');
        $this->email->to($list);
        $this->email->subject('testing my mail function with CodeIgniter');
        $this->email->message('&lt;html&gt;&lt;body>this is the content&lt;/body&gt;&lt;/html>');
        $this->email->attach('./img/layout/someImage.jpg');
        
        if ( ! $this->email->send()){
            echo 'error! <br />';
            // Generate error
        }
        echo $this->email->print_debugger();
    }    
}
?&gt;

the solution was to add

Code:
$this->email->set_newline("\r\n");
right after the call for the initialize function. Since it seems initialize don't do the job (don't know why).


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.