aarbee Posted May 8, 2014 Report Posted May 8, 2014 I have moved the website of my va, to a newer hosting company. Except for several errors, which have been corrected, or are only a small nuisance, I have one that is bugging me. 75% of the mails send to pilots do not arrive, because the mails receive a 550 message, meaning that the email address does not exist. Further investigation tells you that the mail has been rejected because the mailserver was on a blacklist. I emailed my hosting company and they said:"If you use the standard smtp on port 25, you have the risk that it is blacklisted". You should use the fixed address and ports. It was not difficult to find, where to change it, but I could not find where/how to add that the mailservers needs authentication through SSL or TLS. Can somebody maybe point me to where these protocols? Quote
Members Vangelis Posted May 8, 2014 Members Report Posted May 8, 2014 The only email settings that i am aware of are those Config::Set('EMAIL_FROM_NAME', ''); Config::Set('EMAIL_FROM_ADDRESS', ''); Config::Set('EMAIL_USE_SMTP', false); # Add multiple SMTP servers by separating them with ; Config::Set('EMAIL_SMTP_SERVERS', ''); Config::Set('EMAIL_SMTP_PORT', '25'); Config::Set('EMAIL_SMTP_USE_AUTH', false); Config::Set('EMAIL_SMTP_USER', ''); Config::Set('EMAIL_SMTP_PASS', ''); I do not know if that is any help for you Quote
aarbee Posted May 8, 2014 Author Report Posted May 8, 2014 Thanks for pointing that out. That is what I had changed. But I have to put in, somewhere, that SSL or TLS is being used. Where do I do that? Quote
aarbee Posted May 9, 2014 Author Report Posted May 9, 2014 My hosting company has been looking into it as well. And they thought they had the solution. But it still does not work. They thought that the standard phpmailer was used and that something for the TLS could be used, on default. So they filled the local.config.php for me: # Email Settings Config::Set('EMAIL_FROM_NAME', 'City Link Virtual Airlines'); Config::Set('EMAIL_FROM_ADDRESS', 'my@email.com'); Config::Set('EMAIL_USE_SMTP', true); # Add multiple SMTP servers by separating them with ; Config::Set('EMAIL_SMTP_SERVERS', 'smtp.server.com'); Config::Set('EMAIL_SMTP_PORT', '587'); Config::Set('EMAIL_SMTP_USE_AUTH', true); Config::Set('EMAIL_SMTP_USER', 'my@email.com'); Config::Set('EMAIL_SMTP_PASS', 'secret'); Config::Set('EMAIL_SMTP_SECURE', 'tls'); # Setup TLS in PHPMailer Then added this in the util.class.php row 253 $mail->SMTPSecure = Config::Get('EMAIL_SMTP_SECURE'); I tried that out, but it did not work either. So I guess, I need to add something too. I am open to any suggestion. Quote
Digiover Posted June 6, 2014 Report Posted June 6, 2014 In order to send authenticated SMTP email over TLS, you need the following in your local.config.php (bug fix!): Config::Set('EMAIL_USE_SMTP', true); // Add multiple SMTP servers by separating them with ; Config::Set('EMAIL_SMTP_SERVERS', 'smtp.example.com'); Config::Set('EMAIL_SMTP_PORT', '25'); // or 587 Config::Set('EMAIL_SMTP_USE_AUTH', true); Config::Set('EMAIL_SMTP_USER', 'yourname@example.com'); Config::Set('EMAIL_SMTP_PASS', 'p4ssword'); Config::Set('EMAIL_SMTP_SECURE', 'tls'); Then, open up /core/classes/Util.class.php, scroll to line 257 and add in that code block: if(Config::Get('EMAIL_SMTP_USE_AUTH') == true) { $mail->SMTPAuth = Config::Get('EMAIL_SMTP_USE_AUTH'); // <- this line needs to be added $mail->Username = Config::Get('EMAIL_SMTP_USER'); $mail->Password = Config::Get('EMAIL_SMTP_PASS'); $mail->SMTPSecure = Config::Get('EMAIL_SMTP_SECURE'); } Otherwise PHPMailer won't trya authenticating because $mail->SMTPAuth value isn't set. Quote
aarbee Posted June 12, 2014 Author Report Posted June 12, 2014 Digiover, Thanks for posting this. Even more thanks for helping me out, last week. I think it all works wonderfull since then. RobB Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.