Joomla 3.5 Upgrade: SMTP() Connect Failed

General questions relating to Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting.
Forum Post Assistant - If you are serious about wanting help, you should use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10
Locked
User avatar
spookchief
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Mon Mar 19, 2012 11:22 pm
Location: Richmond, VA USA
Contact:

Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by spookchief » Tue Mar 29, 2016 9:09 am

After upgrading to Joomla 3.5, SMTP mailer fails. I did not notice this because the lack of email from the site to me doesn't mean anything. Until I get email directly from others asking (!) why I have not responded to the messages they sent to me through the Website contact form. Oops.

Ours is the site for a non-profit U.S. Navy veteran organization (https://usncva.org) and our annual reunion is fast approaching. Going dead for email is an extremely signification.

The Joomla global Mail Settings are:

Send Mail - Yes
Mailer - SMTP
From email [......]
From Name [......]
Disable Mass Mail - No
SMTP Authentication - Yes
SMTP Security - SSL
SMTP Port - 587

Website configuration:

Apache
OS: Linux b
PHP version: 5.6.17
MySQLi version: 5.5.42-37.1-log

Will Joomla 3.5.1 fix this? Approximately how soon will that be issued?

Thanks very much!
Don White

User avatar
AMurray
Joomla! Exemplar
Joomla! Exemplar
Posts: 7823
Joined: Sat Feb 13, 2010 7:35 am
Location: Australia

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by AMurray » Tue Mar 29, 2016 9:57 pm

Have you tried the sendmail option instead of SMTP? (at least to check if that works).

It may not be a Joomla problem if the SMTP server is external to Joomla e.g. using a Gmail account such as you@gmail.com, as opposed to an email associated with the domain like you@yoursite.com.

I will assume you also input your SMTP server credentials (correctly) for authentication? Perhaps check with your mail provider that all the details are correct?
Regards - A Murray

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 14773
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by toivo » Tue Mar 29, 2016 10:15 pm

Using Gmail as the SMTP server works all right in Joomla 3.5.0, simply by following this tutorial which is still current: https://docs.joomla.org/How_do_I_use_Gm ... _server%3F

If you want to troubleshoot the dialogue between Joomla's PHPMailer SMTP and the other server, you can record all messages into the PHP error log by making a temporary modification in one core file.

Edit the file libraries/joomla/mail/mail.php and add the following lines to the beginning of the function useSmtp(), after line 467:

Code: Select all

     // debug SMTPmailer
      // $this->SMTPDebug    = 3;        // output data, commands and connection status
      $this->SMTPDebug    = 4;           // low level data output, all messages
      $this->Debugoutput   = 'error_log';   // output to PHP error log as configured in php.ini
Make sure you keep the original version of the file mail.php and restore it before the log file grows too big.
Toivo Talikka, Global Moderator

User avatar
spookchief
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Mon Mar 19, 2012 11:22 pm
Location: Richmond, VA USA
Contact:

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by spookchief » Wed Mar 30, 2016 12:40 am

AMurray wrote:Have you tried the sendmail option instead of SMTP? (at least to check if that works).

It may not be a Joomla problem if the SMTP server is external to Joomla e.g. using a Gmail account such as you@gmail.com, as opposed to an email associated with the domain like you@yoursite.com.

I will assume you also input your SMTP server credentials (correctly) for authentication? Perhaps check with your mail provider that all the details are correct?
Sorry, wrong on all counts. SMTP worked in each version of Joomla up to 3.5. Now it doesn't. Cannot compromise the security of personal information sent through the Website by over 500 Website account holders and the 2,000+ association members who are U.S. Navy veterans by removing encryption just to make Joomla work.

Yes, the SMTP server credentials are correct; they were correct before the upgrade to 3.5 and they remain correct now.
Don White

User avatar
spookchief
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Mon Mar 19, 2012 11:22 pm
Location: Richmond, VA USA
Contact:

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by spookchief » Wed Mar 30, 2016 12:45 am

toivo wrote:Using Gmail as the SMTP server works all right in Joomla 3.5.0, simply by following this tutorial which is still current: https://docs.joomla.org/How_do_I_use_Gm ... _server%3F

If you want to troubleshoot the dialogue between Joomla's PHPMailer SMTP and the other server, you can record all messages into the PHP error log by making a temporary modification in one core file.

Edit the file libraries/joomla/mail/mail.php and add the following lines to the beginning of the function useSmtp(), after line 467:

Code: Select all

     // debug SMTPmailer
      // $this->SMTPDebug    = 3;        // output data, commands and connection status
      $this->SMTPDebug    = 4;           // low level data output, all messages
      $this->Debugoutput   = 'error_log';   // output to PHP error log as configured in php.ini
Make sure you keep the original version of the file mail.php and restore it before the log file grows too big.
We don't use Gmail. We use the Web and Email servers that are included in our Hosting account and for which we have purchased and maintain our SSL certificate.

Here's the issue for me: I've always trusted the Joomla development team and cycle and have not, until now, been disappointed. The 3.5 update broke a key function; it must be fixed. Work-arounds that involve less security just to make the upgrade seem to work are not solutions.

When will version 3.5.1 be released? This problem is noted in many forums and across the Web.
Don White

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 14773
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by toivo » Wed Mar 30, 2016 10:24 am

One possible reason that stops the mail function in PHPMailer v5.2.10, introduced in Joomla 3.5.0, is an issue with the certificates of the SMTP servers, for example if one of them is self signed or expired.

The above modification would help to pinpoint the actual cause. Updates in 3.5.1 will improve the error logging in Joomla in relation to the mailer.

Joomla 3.5.1 Release Candidate 2 became available 14 hours ago. Not to be used in production, though.
Toivo Talikka, Global Moderator

User avatar
spookchief
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Mon Mar 19, 2012 11:22 pm
Location: Richmond, VA USA
Contact:

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by spookchief » Wed Mar 30, 2016 12:09 pm

toivo wrote:One possible reason that stops the mail function in PHPMailer v5.2.10, introduced in Joomla 3.5.0, is an issue with the certificates of the SMTP servers, for example if one of them is self signed or expired.

The above modification would help to pinpoint the actual cause. Updates in 3.5.1 will improve the error logging in Joomla in relation to the mailer.

Joomla 3.5.1 Release Candidate 2 became available 14 hours ago. Not to be used in production, though.
In our case, the SSL certificate is not self-signed. Thanks for the information regarding the new Release Candidate update; I never use RC versions on production sites.

I am not ungrateful for your comments and suggestions. I'm shown here as a "Joomla Apprentice" because I have rarely had an issue with or about Joomla that I have needed to address here. The root cause of almost all matters I've encountered since I started using Joomla in 2005 has been with extensions or plugins. I sincerely admire the developers and leaders of the Joomla project.

I hope that 3.5.1 is available very soon because the problem I've addressed here directly affects our membership.

Cheers.
Don White

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 29099
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by Per Yngve Berg » Wed Mar 30, 2016 4:10 pm

spookchief wrote:In our case, the SSL certificate is not self-signed.
You talk about the certificate for the web site, but is it also valid for the smtp server?

deleted user

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by deleted user » Wed Mar 30, 2016 6:05 pm

So here's the thing with the PHPMailer "quirks". The version shipped with Joomla 3.5, as explained above, includes what PHPMailer calls an "opportunistic TLS" feature where it will try to upgrade a connection if based on the server's connection headers it detects it is able to do so. A mix of this and how PHP 5.6 validates certificates on secure connections can cause the issue you are experiencing. Ultimately what this means is that your SMTP installation is configured in a way that it advertises support for TLS security measures but for whatever reason that doesn't seem to work (either the mailer's configuration is missing some configuration setting, the certificate chain isn't fully valid, or something else... I'm not 100% sure on what all could cause that to mis-report).

Joomla 3.5.1 includes a patch that will attempt to resend mail if sending failed and this opportunistic TLS flag is enabled (unfortunately the way PHPMailer throws errors it isn't possible to detect only this specific error so the resend mechanism will trigger on all failed sends). Ultimately though (and personally speaking) PHPMailer's feature (which even they've noted as not being all that stable) is something that needs some work to better detect these conditions and it also exposes what could be misconfigured SMTP servers and possibly gives data to system admins to get their setups right.

User avatar
spookchief
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Mon Mar 19, 2012 11:22 pm
Location: Richmond, VA USA
Contact:

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by spookchief » Wed Mar 30, 2016 6:08 pm

Per Yngve Berg wrote:
spookchief wrote:In our case, the SSL certificate is not self-signed.
You talk about the certificate for the web site, but is it also valid for the smtp server?
Yes. I hate to sound frustrated, but what difference would it make if the SSL certificate did not apply to the SMTP server? (Or why would we use an SSL certificate that was valid only for the Web server?) Never mind, the thing is that SMTP email worked until Joomla was updated to version 3.5. The sole error message remains:

SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/ ... leshooting
Don White

User avatar
spookchief
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Mon Mar 19, 2012 11:22 pm
Location: Richmond, VA USA
Contact:

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by spookchief » Wed Mar 30, 2016 6:14 pm

mbabker wrote:So here's the thing with the PHPMailer "quirks". The version shipped with Joomla 3.5, as explained above, includes what PHPMailer calls an "opportunistic TLS" feature where it will try to upgrade a connection if based on the server's connection headers it detects it is able to do so. A mix of this and how PHP 5.6 validates certificates on secure connections can cause the issue you are experiencing. Ultimately what this means is that your SMTP installation is configured in a way that it advertises support for TLS security measures but for whatever reason that doesn't seem to work (either the mailer's configuration is missing some configuration setting, the certificate chain isn't fully valid, or something else... I'm not 100% sure on what all could cause that to mis-report).

Joomla 3.5.1 includes a patch that will attempt to resend mail if sending failed and this opportunistic TLS flag is enabled (unfortunately the way PHPMailer throws errors it isn't possible to detect only this specific error so the resend mechanism will trigger on all failed sends). Ultimately though (and personally speaking) PHPMailer's feature (which even they've noted as not being all that stable) is something that needs some work to better detect these conditions and it also exposes what could be misconfigured SMTP servers and possibly gives data to system admins to get their setups right.
Thanks for your response. I have checked with BlueHost, which has an open ticket on the issue. However, the SSL certificate and the SMTP server seem to be correctly configured. At least, their configurations were not changed prior to or after I updated Joomla to version 3.5. It seems to me that, if the SMTP email worked - and it did - before the update and that no configuration (Joomla, PHP [5.6], SSL, or SMTP server) was changed, then the update is the likely culprit.

As for TLS, I configured SMTP security to use SSL, not TLS.
Don White

deleted user

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by deleted user » Wed Mar 30, 2016 6:39 pm

Like we said above, it probably has to do with updates in PHPMailer. So sure, we can say the Joomla update broke your site's email functions since that included an updated version of the PHPMailer library, but at the root of things it's not a Joomla issue that's causing it.

If your issue is affected by the opportunistic TLS feature in PHPMailer, Joomla 3.5.1 should fix it. If it's not, then it'll probably need more troubleshooting.

As for why you might be getting this issue (if it's the opportunistic TLS thing), if your mail server is advertising that it supports TLS (this is based on data received during the SMTP hello operation, specifically the transaction returns a "STARTTLS" statement) and the option in PHPMailer is set to true (which according to the code with SSL security it shouldn't even be doing this, but let's ignore that for a moment), PHPMailer will try to upgrade to TLS and if the connection with that doesn't work then the whole send process fails over.

I don't know what all changed with PHPMailer between the version shipped with Joomla 3.4.8 and 3.5.0, but I do know downgrading it isn't an option. The TLS thing has been dealt with in Joomla's class. If it's another issue, sorry to say but I wouldn't know what to dig into next without hacking the PHPMailer class to boost up the types of internal log messages it spits out.

User avatar
spookchief
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Mon Mar 19, 2012 11:22 pm
Location: Richmond, VA USA
Contact:

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by spookchief » Wed Mar 30, 2016 6:47 pm

mbabker wrote:...If your issue is affected by the opportunistic TLS feature in PHPMailer, Joomla 3.5.1 should fix it. If it's not, then it'll probably need more troubleshooting...
Thanks. As I've written, I'm eagerly awaiting Joomla 3.5.1.

Cheers,

Don White
Don White

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 14773
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by toivo » Wed Mar 30, 2016 6:59 pm

A two line addition to libraries/Joomla/mail/mail.php, shown above, will log the all the messages in the dialogue with the SMTP server to the PHP error log, if the finer details are required.

I should really add this feature as a troubleshooting option to Global Configuration - Server - Mail for the next version.
Toivo Talikka, Global Moderator

deleted user

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by deleted user » Wed Mar 30, 2016 7:05 pm


User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 14773
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by toivo » Wed Mar 30, 2016 7:14 pm

You beat me to it. Looks good. Ideally the option would be separate from the general debugging option which affects the whole site, but I guess in normal circumstances this level of troubleshooting is necessary only during the installation of the site.

Also, the log file could be some other than the PHP error log, if possible.
Toivo Talikka, Global Moderator

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 29099
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by Per Yngve Berg » Wed Mar 30, 2016 7:18 pm

Have you tried to use PhPMailer instead of SMTP?

What host for smtp do you use (smtp.yourdomain.org or smtp.yourisp.com)?

If the certificate is issued for smtp.yourisp.com, then it will fail for other domains.

bomkallo
Joomla! Explorer
Joomla! Explorer
Posts: 251
Joined: Fri Jun 14, 2013 7:27 am
Location: Poland

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by bomkallo » Wed Mar 30, 2016 9:06 pm

I'm using SMTP everywhere, you auth. or you do not. Do not even try to set 'Send from/as' different from your own mail provider. In case of !J contact forms I always create an email for client and I do authorise it fully, in all other cases in past and future I hit walls from local severs or I get rejects from other mailers.

Set 'send from addr' equal to smtp username and you go ok. I've just tested this out and everytime I change 'send as.../from' I get failures. So in case of auth. you can't say you're Bob while you're sending an email from John.

SMTP is the best method to auth. but don't mess with it (check your server logs if you really hit problems). All other methods should probably be removed as many servers do checks and filter all crap of that kind a spam. I found SMTP working while I use it as 'ME' not a fake guy who tries to gives me spam.

For more, check how mail works. Imho it is the biggest crap system that's been developed.

doggy1
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Jul 09, 2008 11:58 pm

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by doggy1 » Fri Apr 01, 2016 10:18 am

I have exactly the same problem.

Phpmailer and SMTP do NOT work any longer at 3.5.

I wish I had not upgraded.

We are a large religious organisation and this is severely impacting us.

Ironically, our weekly newsletter goes out using the identical credentials and is unaffected.

We use inmotionhosting and all our certificates etc are fully in order and up to date.


Dave

deleted user

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by deleted user » Fri Apr 01, 2016 2:17 pm

*sigh* I give up. PHPMailer is NOT broken. Yes, it has a feature enabled by default which can cause SMTP transactions to fail. As posted here and probably a bajillion other places in the last week, there's a patch in Joomla in 3.5.1 to try and work around this PHPMailer feature. Folks, please understand something, the entire PHPMailer library is NOT busted. The (IMO poorly implemented) feature in question makes it look broken and continuing to make posts saying "Joomla email functions are broken on 3.5" isn't getting anyone anywhere. All of the relevant data is posted and Joomla (as a consumer of PHPMailer's library, not the author of it) has a workaround in place for one possible fail path. If you have other concerns with the PHPMailer library, I would suggest taking them to their forums instead of posting here.

alelkin
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Mon Dec 14, 2015 11:51 pm

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by alelkin » Sat Apr 23, 2016 7:44 pm

I have Joomla 3.5.1 and mail does not work.

Does not work any of functions (php mail, sendmail or smtp)

What to do?

wiedring
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Wed Mar 23, 2016 9:44 am

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by wiedring » Mon May 02, 2016 7:21 pm

i have the same problem, never can register on my site because the send mail or smtp does not work.
my provider cannot manage the problem.

what i should to do?

jmack50
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Thu Oct 22, 2009 5:09 pm

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by jmack50 » Sat May 07, 2016 1:16 pm

My problem is similar to others in this thread but it only started AFTER installing Joomla 3.5.1. It was working with 3.5.

I can no longer send Mass Mail. I get this error:

An error has occurred.
0 Invalid address:

In mail settings I have used Send Test Mail for:
PHP Mail
Sendmail
SMTP

and they ALL WORK.

Does this bit of info help someone point us in the right direction?

User avatar
jbultena
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 155
Joined: Fri Oct 07, 2005 7:43 am
Location: Veendam
Contact:

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by jbultena » Wed Jul 06, 2016 10:04 am

Sign-in with your google account, and click https://myaccount.google.com/intro/security

now on the bottom right you will find Allow less secure apps: OFF Some non-Google apps and devices use less secure sign-in technology, which could leave your account vulnerable. You can turn off access for these apps (which we recommend) or choose to use them despite the risks.

7racecar7
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Fri Oct 02, 2009 6:14 pm

Re: Joomla 3.5 Upgrade: SMTP() Connect Failed

Post by 7racecar7 » Thu Oct 06, 2016 12:39 pm

Has anyone come up with a fix to the email form not sending? I can get the "test" email but nothing from the form


Locked

Return to “General Questions/New to Joomla! 3.x”