![]() |
E-mail library not properly sending AUTH LOGIN - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: E-mail library not properly sending AUTH LOGIN (/showthread.php?tid=16369) |
E-mail library not properly sending AUTH LOGIN - El Forum - 03-04-2009 [eluser]mscahill[/eluser] I'm attempting to send e-mail through an authenticated SMTP server with CI's e-mail library. I've successfully sent an e-mail with fsockwrite, but cannot do so with CI. Here is the error I get when trying to send an e-mail: hello: The following SMTP error was encountered: Failed to send AUTH LOGIN command. Error: from: The following SMTP error was encountered: to: The following SMTP error was encountered: data: The following SMTP error was encountered: 451 4.7.0 Timeout waiting for client input The following SMTP error was encountered: 451 4.7.0 Timeout waiting for client input Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method. Any ideas? I can't seem to isolate the point at which the error occurs. Perhaps it's extra characters after the HELO or something... E-mail library not properly sending AUTH LOGIN - El Forum - 03-05-2009 [eluser]mscahill[/eluser] So it appears as if CI is getting no response from EHLO. In fact, CI doesn't even wait for a response from EHLO. When it tries to send AUTH LOGIN, though, it still gets no response. Could this be an e-mail configuration problem? Line ending problem? Timing problem? E-mail library not properly sending AUTH LOGIN - El Forum - 03-05-2009 [eluser]sophistry[/eluser] it can help to post code. E-mail library not properly sending AUTH LOGIN - El Forum - 03-05-2009 [eluser]mscahill[/eluser] I figured it out right before lunch. I had set the configuration wrong. I had: Code: $config['crlf'] = '\r\n'; instead of: Code: $config['crlf'] = "\r\n"; E-mail library not properly sending AUTH LOGIN - El Forum - 03-06-2009 [eluser]whobutsb[/eluser] Oh wow this is awesome! Thank you so much for posting that change. I've been trying everything to figure out what was wrong with the SMTP mail!!! Thank you! E-mail library not properly sending AUTH LOGIN - El Forum - 01-20-2010 [eluser]bhensonweb[/eluser] I had this problem as well, and this fixed it! I have been in the habit of using the single quotations for string variables, maybe I should change... This was the returned error: 451 See http://pobox.com/~djb/docs/smtplf.html. The following SMTP error was encountered: 451 See http://pobox.com/~djb/docs/smtplf.html. Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method. Thanks. E-mail library not properly sending AUTH LOGIN - El Forum - 01-20-2010 [eluser]sophistry[/eluser] using single-quotes for putting strings into variables is a good habit, don't change. single-quotes are faster. they are easier to read. they tell other programmers (who may read your code) that you don't intend the string to be parsed for variables. double-quotes tells PHP to look at the string and swap in any variables. in this case, (special chars CR LF TAB etc..) you NEED to put them in double-quotes so that PHP "interprets" them correctly. just remember: always use double-quotes for the special chars: "\n\r\t" (note: this is not an exhaustive list, just the most common) |