Mails are not sending after upgrading to Joomla 3.6

Need help upgrading your Joomla! website or converting to Joomla! 3.x?

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
User avatar
kishoremnk
Joomla! Intern
Joomla! Intern
Posts: 75
Joined: Fri Sep 18, 2009 5:24 am
Contact:

Mails are not sending after upgrading to Joomla 3.6

Post by kishoremnk » Wed Jul 20, 2016 7:01 am

Hi All,

After upgrading the Joomla to 3.6 successfully, sending mail functionality is not working. Its working fine till before the update. I couldn't find any solutions yet. This happens earlier after updating to some other Joomla version, so I changed the code from JMail::getInstance to the below code. Again after updating to 3.6 its not working.

Here is the code to send the mails:

Code: Select all

$mail = new JMail(false);
$mail->sendMail($row->email, $customername, JText::_('WRI_INFO_EMAIL'), $subject, $admin_email_msg, 1, NULL, NULL, $dest);
Thanks in advance.
Nanda Kishore (PHP Developer - welcome to any suggestions / help / guiding regarding PHP and Joomla)
http://www.avidit.in/

User avatar
JAVesey
Joomla! Hero
Joomla! Hero
Posts: 2634
Joined: Tue May 14, 2013 1:21 pm
Location: Cardiff, Wales, UK
Contact:

Re: Mails are not sending after upgrading to Joomla 3.6

Post by JAVesey » Wed Jul 20, 2016 8:44 am

There is no need to hack core files as the email functionality works as it should in v3.6.0

You need to look at a setting local to your installation. Have you tried resaving the email settings in Global Confirmation? Change the setting to the alternate, save it and then change it back and save. I've seen this work before.
John V
Cardiff, Wales, UK
Joomla 5.1.0 "live" site on PHP 8.2.15 and MariaDB 10.11.7
Joomla 5.1.0 on XAMMP for OSX with PHP 8.2.4 and MariaDB 10.4.28

User avatar
kishoremnk
Joomla! Intern
Joomla! Intern
Posts: 75
Joined: Fri Sep 18, 2009 5:24 am
Contact:

Re: Mails are not sending after upgrading to Joomla 3.6

Post by kishoremnk » Wed Jul 20, 2016 9:47 am

Hi John,

I'm not hacking any core files, I have written this code to send emails once form submitted in my custom component. It's mail sending working fine in other areas and this JMail code is not working after upgrading the Joomla from 3.5.1 to 3.6.0

Thanks again.
Nanda Kishore (PHP Developer - welcome to any suggestions / help / guiding regarding PHP and Joomla)
http://www.avidit.in/

User avatar
JAVesey
Joomla! Hero
Joomla! Hero
Posts: 2634
Joined: Tue May 14, 2013 1:21 pm
Location: Cardiff, Wales, UK
Contact:

Re: Mails are not sending after upgrading to Joomla 3.6

Post by JAVesey » Wed Jul 20, 2016 10:15 am

My apologies.

However, my advice still stands; it's nothing to do with the Joomla code and you need to look at your own web environment or settings. You shouldn't need to use additional code.
John V
Cardiff, Wales, UK
Joomla 5.1.0 "live" site on PHP 8.2.15 and MariaDB 10.11.7
Joomla 5.1.0 on XAMMP for OSX with PHP 8.2.4 and MariaDB 10.4.28

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: Mails are not sending after upgrading to Joomla 3.6

Post by sovainfo » Wed Jul 20, 2016 10:38 am

Suggest to check the parameters you are providing, they sound wrong:
#1 site email
#2 site email name
#3 recipient email

BTW: See no reason to not use getinstance passing false as second parameter.

Try debug with class mail if problem persists.
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

User avatar
kishoremnk
Joomla! Intern
Joomla! Intern
Posts: 75
Joined: Fri Sep 18, 2009 5:24 am
Contact:

Re: Mails are not sending after upgrading to Joomla 3.6

Post by kishoremnk » Thu Jul 21, 2016 12:45 pm

Mail settings are correct and I debugged the code but couldn't find any issue with code.

By the way is this correct code to send emails or any other code that we can use apart from this for Joomla 3.6?

Code: Select all

$mail = new JMail(false);
$mail->sendMail($row->email, $customername, JText::_('WRI_INFO_EMAIL'), $subject, $admin_email_msg, 1, NULL, NULL, $dest);
Nanda Kishore (PHP Developer - welcome to any suggestions / help / guiding regarding PHP and Joomla)
http://www.avidit.in/

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: Mails are not sending after upgrading to Joomla 3.6

Post by sovainfo » Thu Jul 21, 2016 2:02 pm

Impossible to say without any explanation! Tried to make that clear by naming the parameters.

It is not the code, it is the data you are using in the code. The only concrete values there are 1 and NULL !!!
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

sakattack
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Fri Mar 25, 2011 5:29 pm

Re: Mails are not sending after upgrading to Joomla 3.6

Post by sakattack » Sat Jul 30, 2016 1:52 pm

@ sovainfo and @JAVesey

you say it's a problem with his environment, but you completely ignore the fact that his code used to work just fine before updating to joomla 3.6 . If it is indeed an environment issue, it is clear to me that it manifested BECAUSE of joomla 3.6 . These kind of things are what make me really nervous updating joomla. More than once, I had to test EVERY SINGLE aspect of my websites to make sure that things worked as expected after a joomla update. And more than once, a joomla update consisted of basically useless "changes" and introduced many problems. Joomla needs to slow down it's update cycle dramatically!!!

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: Mails are not sending after upgrading to Joomla 3.6

Post by sovainfo » Sat Jul 30, 2016 2:13 pm

@sakattack Disagree with your assessment, suggest to read more carefully!
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

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

Re: Mails are not sending after upgrading to Joomla 3.6

Post by toivo » Sat Jul 30, 2016 6:23 pm

@kishoremnk, which type of mail is selected in Global Configuration - Server - Mail?

If you are using SMTP and especially Gmail as your mail server, something changed in the PHPMailer library and all of a sudden a problem is reported in the verification of the server certificate during the connection process. I tested the issue and a workaround in both Windows and Linux environment.

The workaround is done by adding the SMTPOptions variable to the mail object with particular values to skip the server verification into the file libraries/joomla/mail/mail.php, in the beginning of the function useSmtp().

Code: Select all

		// 20160728 workaround for certificate verification failure - ref. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
		$this->SMTPOptions = array(
			'ssl' => array(
				'verify_peer' => false,
				'verify_peer_name' => false,
				'allow_self_signed' => true
			)
		);	
		// 20160728 end
Last edited by toivo on Sat Jul 30, 2016 11:08 pm, edited 1 time in total.
Reason: added code
Toivo Talikka, Global Moderator

User avatar
kishoremnk
Joomla! Intern
Joomla! Intern
Posts: 75
Joined: Fri Sep 18, 2009 5:24 am
Contact:

Re: Mails are not sending after upgrading to Joomla 3.6

Post by kishoremnk » Mon Aug 01, 2016 4:26 pm

Sorry for late reply,

After debugging a lot finally I got the issue, it is with this line : JText::_('WRI_INFO_EMAIL')

I added an email address to 'WRI_INFO_EMAIL' - Language Constant (client want to change that email from language file frequently) which I used in all email areas instead of admin email from global config. Now it seems to me JMail is not taking JText after upgrade to 3.6 (but not sure this is the problem).

So I have used global config admin details like the below, which prevents my client requirement.

Code: Select all

$app = JFactory::getApplication();
$adminMail = $app->getCfg('mailfrom');
$adminName = $app->getCfg('fromname');
Thanks to all who are trying to solve the issue.
Nanda Kishore (PHP Developer - welcome to any suggestions / help / guiding regarding PHP and Joomla)
http://www.avidit.in/

sovainfo
Joomla! Exemplar
Joomla! Exemplar
Posts: 8808
Joined: Sat Oct 01, 2011 7:06 pm

Re: Mails are not sending after upgrading to Joomla 3.6

Post by sovainfo » Mon Aug 01, 2016 6:28 pm

Suggest to enhance your code to include some proper error handling. Unfortunately JMail doesn't provide the error handling. That means you need to do it yourself. This includes both exception handling and dealing with false return values.

It shouldn't matter that the argument is a call to another procedure as long as it provides an acceptable value. The sendMail just returns false when something is wrong! See usage of JMail in Joomla code. Add error handling to it.
Issue with migrating? Include logs/joomla_update.php in your report!
Blank screen? Verify pagesource for HTML code (javascript error)
Installation failing on populating database? Install with set_time_limit(0)
Document your customizations!

ReactionFaye
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Wed Aug 17, 2016 9:37 pm

Re: Mails are not sending after upgrading to Joomla 3.6

Post by ReactionFaye » Wed Aug 17, 2016 9:42 pm

I ran into this same problem. I've updated 2 sites to 3.6.2 and found they both stopped sending SMTP with the settings TLS port 465. One site is using a custom HTML form, the other is using BreezingForms.

I noticed the configuration dropdown had changed from SSL and TLS as separate choices and were now a joint dropdown option. I tried a variety of ports until I finally changed the settings to None and port 2525. Now my emails go through (no hack required).

I think there is evidence that this is a problem with the most recent set of Joomla updates. Either this was unexpected, or it was intentional and there should be some very clear documentation on the changes.

kgriffin
Joomla! Intern
Joomla! Intern
Posts: 80
Joined: Sun Jul 27, 2008 1:15 pm

Re: Mails are not sending after upgrading to Joomla 3.6

Post by kgriffin » Wed Aug 17, 2016 10:53 pm

I am reposting what I posted in another thread when I did not find this one:

I just upgraded to 3.6 (then 3.6.1, then 3.6.2) and email notifications are not successfully being sent out. When I try to email through Users Mass Email, I get this error:

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

However, AcyMailing, which uses the same SMTP server configuration I have in Joomla's Global Config is successfully emailing out newsletters, so it is not server side.

Everything worked fine in 3.5+ and no settings were changed in the email config and I am not using any custom code whatsoever. I read upstream on this thread that Joomla 3.6's email is working fine and it must be the environment. That is false. This is a Joomla issue.

Please, someone respond with something helpful. I am not comfortable setting the security protocol to None and using port 2525 as a solution.

rs3511
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Thu Dec 06, 2012 8:41 pm

Re: Mails are not sending after upgrading to Joomla 3.6

Post by rs3511 » Tue Aug 30, 2016 12:31 pm

I have also been trying to solve this issue. I have found 2 ways to work around the issue. Seems to be related to PHP7 so is anyone is experiencing the j3.6.2 email issue and not on PHP7? Reverting back to PHP5.6 on Joomla 3.6.2 and emails started working again for me. Also if PHP7 is a must have, change the 'mailer setting' to SendMail in Global Configuration --> Server. This also worked for me. This is the workaround that I am going with until the issue is solved in Joomla/PHP7/Bootstrap/Jquery/ or where-ever lies. I don't like using SendMail but its working.

kgriffin
Joomla! Intern
Joomla! Intern
Posts: 80
Joined: Sun Jul 27, 2008 1:15 pm

Re: Mails are not sending after upgrading to Joomla 3.6

Post by kgriffin » Tue Aug 30, 2016 3:08 pm

I am using PHP 5.6.2. I will try the SendMail for Joomla since all our large mailings go out through AcyMailing which works fine.

Elnino38
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Mon Aug 15, 2011 10:06 pm
Contact:

Re: Mails are not sending after upgrading to Joomla 3.6

Post by Elnino38 » Sun Sep 04, 2016 1:27 pm

I do second this issue.

I had SMTP configured with TLS protocol on Office365 and it stopped working after the upgrade to Joomla 3.6.2.
I removed the SSL protocol and set the security to "none" + change the port to 25 and it works now. But it's less secure of course.

I would strongly advise Joomla team to look into this problem.
Calgary Web Design
http://www.beginwithb.com

david_smith
Joomla! Intern
Joomla! Intern
Posts: 64
Joined: Sat Mar 17, 2012 3:33 am

Re: Mails are not sending after upgrading to Joomla 3.6

Post by david_smith » Fri Sep 23, 2016 10:05 am

My sites have the same problem with PHP 7 and J 3.6.2. PHPMail is used and the site reports the mail is sent, but it never arrives. Switch back to PHP 5.4 and PHPMail works well, though with the loss of v7 speed.

What changed in mail between PHP versions? What Joomla or Host config settings might have a bearing on this?

rs3511
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Thu Dec 06, 2012 8:41 pm

Re: Mails are not sending after upgrading to Joomla 3.6

Post by rs3511 » Wed Sep 28, 2016 7:29 pm

I would like to think that this issue will be addressed by the Joomla development world soon but it seems that we are alone with our email problems. We are still forced to use SendMail or php5 in order to have emails sent as expected.

perspective4102
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Jun 28, 2011 2:34 pm
Contact:

Re: Mails are not sending after upgrading to Joomla 3.6

Post by perspective4102 » Wed Oct 19, 2016 6:35 am

I have same problem with PHP 7, do we have any update?
[url]http://ขายเสื้อยืด.net[/url]
http://pixpopshop.com

User avatar
adam_nz
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 157
Joined: Thu Nov 03, 2005 7:21 am
Location: Auckland - New Zealand
Contact:

Re: Mails are not sending after upgrading to Joomla 3.6

Post by adam_nz » Fri Oct 28, 2016 4:46 am

The 3.6.4 upgrade broke my SMTP/TLS again. We had this problem with 3.5.

A quick paste over of the 3.6.2 phpmailer directory got it working again, so it looks like the old bug has been reintroduced with 3.6.4.

rs3511
Joomla! Apprentice
Joomla! Apprentice
Posts: 12
Joined: Thu Dec 06, 2012 8:41 pm

Re: Mails are not sending after upgrading to Joomla 3.6

Post by rs3511 » Mon Oct 31, 2016 3:24 pm

PHP7.0.9 email issue was reintroduced in j3.6.4. Deja vu anyone?! I realize that the problem lies within the recent php changes but come on, the Joomla development world IS BETTER THAN THIS!!

User avatar
adam_nz
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 157
Joined: Thu Nov 03, 2005 7:21 am
Location: Auckland - New Zealand
Contact:

Re: Mails are not sending after upgrading to Joomla 3.6

Post by adam_nz » Tue Nov 01, 2016 2:25 am

Does anyone know whether the problem occurs with all versions of PHP including and *later than* PHP 7.0.9? I have the option of running 7.0.12 or even 7.1 RC.

joomjan
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Fri Nov 17, 2006 1:14 am

Re: Mails are not sending after upgrading to Joomla 3.6

Post by joomjan » Sun Feb 05, 2017 6:08 pm

In joomla 3.6.5 the core contact form no longer sends any mail.

Backend everything seems to work nicely:
The "send a test"-button on the admin page *does* send mail (whether sendmail or SMTP)
The AcyMailing extension also *does* send mail.

Frontend the contact form does not work. There is no error message of any kind, and it does not send a copy mail to sender. Everything else on the site is functioning normally.

- Fox contact form has the same problem as it probably depends on the joomla core.
- Changing from Sendmail to SMTP and back does not help.
- I have been running on PHP 7.x, but as this for some of you seemed to be an issue, I reverted to PHP 5.6.30. No success.
- My ISP has checked all server configs and finds nothing wrong on their side. They believe there is a script error in joomla.
- Yes, I have reinstalled the joomla 3.6.5 core.
- I have optimalised the database tables.

Nothing of the above mentioned solves the problem, and now I'm lost.

Not really expecting an answer, as I have more or less given up. But perhaps someone else has a similar problem?

joomjan
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Fri Nov 17, 2006 1:14 am

Re: Mails are not sending after upgrading to Joomla 3.6

Post by joomjan » Tue Feb 07, 2017 9:32 pm

joomjan wrote:In joomla 3.6.5 the core contact form no longer sends any mail.

Frontend the contact form does not work. There is no error message of any kind, and it does not send a copy mail to sender. Everything else on the site is functioning normally.
I found a way round the issue by installing FlexiContact. That actually works.
Joomla core contact form does not.

Yasir Abbas
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Mon Feb 06, 2017 7:53 am

Re: Mails are not sending after upgrading to Joomla 3.6

Post by Yasir Abbas » Wed Feb 08, 2017 8:04 am

log out from joomla and remove your cache then it will be ok..

ncwebdude2
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Sat Mar 21, 2015 5:24 pm

Re: Mails are not sending after upgrading to Joomla 3.6

Post by ncwebdude2 » Wed Feb 15, 2017 9:54 pm

I had to use RSFormsPro for a work around. I hope that this is not affecting any of my other sites.

joomroz
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Fri Apr 15, 2011 1:54 pm

Re: Mails are not sending after upgrading to Joomla 3.6

Post by joomroz » Thu Jun 08, 2017 11:08 am

I have got the same problem on Joomla 3.7.2 on nginx server with php7.0.19

back-end: test mail with phpmail works perfectly.
front-end:
if logged in, mail is sent ( I use chronoforms v5).
if the user is NOT logged on front-end... sending mail fails.

Also sendmail doesn't work and using smtp isn't working ( but I asked my provider for correct port/hostname/security protocol.maybe I didn't set it correctly in smtp mode).

Could it be an ACL setting that I missed or misconfigured?
I didn't touch acl options at all.
thank you in advance.

vitperov
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu Jun 22, 2017 10:52 am

Re: Mails are not sending after upgrading to Joomla 3.6

Post by vitperov » Thu Jun 22, 2017 10:58 am

Hi, sometimes the problem is related to IPv6.
Some hosters are unable to pass SMTP authentication with IPv6 enabled.

There is solution for Joomla 2.5: connect to mailserver by IPv4, not hostname, but she same code doesn't work for Joomla 3.7.

ncwebdude2
Joomla! Apprentice
Joomla! Apprentice
Posts: 39
Joined: Sat Mar 21, 2015 5:24 pm

Email still not working

Post by ncwebdude2 » Tue Feb 20, 2018 7:01 pm

I am using J 3.8.5. PHP 7.1 and my email has stopped sending again. I have tried a Roboform Contact form and the Joomla contact page, now neither are sending mail. The PHP mail had always been used. I am using GoDaddy for hosting. I have updated the template, cleared the cache and checked all that I could think of.


Locked

Return to “Migrating and Upgrading to Joomla! 3.x”