Welcome Guest, Not a member yet? Register   Sign In
can't send messages with SMTP config
#1

(This post was last modified: 11-30-2015, 11:06 AM by juniorJoel.)

Hello , I know that there are several topics posted about smtp but my problem is a little different. The normal email works fine but when I change the config smtp CI_Email in the mail sends no longer works. As against it only works with SMTP my ISP to the Internet. Thank you in advance.
Reply
#2

Some ISP block all trafic on port 25 (SMTP) to recude the amount of spam that is being send from within their network. You are then forced to use the SMTP server of your ISP or connect to an alternative mailserver on a different port (465 or 587).
Reply
#3

(This post was last modified: 11-30-2015, 11:12 AM by juniorJoel.)

Thanks for your help !

Actually, i use this configuration in the CI_email class (which is right regarding to the values...) :

PHP Code:
var $useragent "CodeIgniter";
 var 
$mailpath "/usr/sbin/sendmail";    // Sendmail path
 var $protocol "smtp"
 var $smtp_host "smtp.myserver.fr";
 var $smtp_user "[email protected]";
 var $smtp_pass "mypassword";
 var $smtp_port  "587";
 var $smtp_timeout 30;
 var $smtp_crypto "TLS";  // for STARTTLS...
 var $_smtp_auth  TRUE// I tried also with FALSE...
 var $_smtp_connect ""

I set  :
PHP Code:
echo $this->email->print_debugger();
$config['log_threshold'] = 4

... but unfortunately i can't see any relevant information in the logs :-(

Thanks again for your help :-)
Reply
#4

Just exit after the print debugger line. It's output is not logged so you will not see anything there
PHP Code:
echo $this->email->print_debugger();
exit(); 
Reply
#5

Hello,

We can see these errors in the debug log :


Quote:220 vps59995.ovh.net ESMTP Postfix
hello: 250-vps59995.ovh.net
250-PIPELINING
250-SIZE 20480000
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN

"Failed sending command" AUTH LOGIN. Error 530 5.7.0 Must issue a STARTTLS command first
from: 530 5.7.0 Must issue a STARTTLS command first

"SMTP error occured" : 530 5.7.0 Must issue a STARTTLS command first
to: 530 5.7.0 Must issue a STARTTLS command first

"SMTP error occured" : 530 5.7.0 Must issue a STARTTLS command first
data: 530 5.7.0 Must issue a STARTTLS command first

"SMTP error occured" : 530 5.7.0 Must issue a STARTTLS command first
221 2.7.0 Error: I can break rules, too. Goodbye.

"SMTP error occured": 221 2.7.0 Error: I can break rules, too. Goodbye.

Please could you have any idea to solve this issue ?
How can we configure STARTTLS into the CI_email class... Huh
THANKS A LOT FOR YOUR HELP Shy
Reply
#6

"tls" in lower case?
Reply
#7

I think you should try port 465 as that is mostly the port when using TLS
Reply
#8

(11-30-2015, 05:38 AM)juniorJoel Wrote: Thanks for your help !

Actually, i use this configuration in the CI_email class (which is right regarding to the values...) :

PHP Code:
var $useragent "CodeIgniter";
 var 
$mailpath "/usr/sbin/sendmail";    // Sendmail path
 var $protocol "smtp"
 var $smtp_host "smtp.myserver.fr";
 var $smtp_user "[email protected]";
 var $smtp_pass "mypassword";
 var $smtp_port  "587";
 var $smtp_timeout 30;
 var $smtp_crypto "TLS";  // for STARTTLS...
 var $_smtp_auth  TRUE// I tried also with FALSE...
 var $_smtp_connect ""

I set  :
PHP Code:
echo $this->email->print_debugger();
$config['log_threshold'] = 4

... but unfortunately i can't see any relevant information in the logs :-(

Thanks again for your help :-)

Hi,

Make sure that your newline is "\r\n"

$newline        = "\r\n" ; 

only \r or only \n will not work and might cause problems.
so use "\r\n" to comply with RFC 822.
Reply




Theme © iAndrew 2016 - Forum software by © MyBB