User tests: Successful: Unsuccessful:
As of 3.6 JMail will return boolean values on error states from certain methods. We will try to detect those and implement appropriate error detection/handling with this pull request.
Changes are made in the following places:
In these locations, find a way to trigger an error with sending a message (the checks are specifically against methods adding email addresses as PHPMailer validates these, so using invalid addresses may do the trick assuming nothing validates the addresses beforehand). Instead of attempting to send the message, depending on what the method was already doing for error handling either sending will be skipped completely or the send will be cancelled with an error message raised.
Status | New | ⇒ | Pending |
Category | ⇒ | Administration Components Front End Installation Plugins |
Labels |
Added:
?
|
@mbabker i tried to send a mail from contact form and no matter what i do it always say: Thank you for your email.
I changes the vars directly in the code to generate an error, but no error:
$contact->email_to = 'aaa';
$email = 'aaa';
$mailfrom = 'aaa';
Here https://github.com/joomla/joomla-cms/pull/11230/files#diff-7178e53b18e4d0dc8db925e8b1be7906R202
The check to decide whether the sent message should be shown was checking if an Exception
was returned, which the send method isn't returning (it's using boolean values). Updated the check.
ok, will restest when i have time. thanks
This isn't going anywhere, but I am.
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-09-12 20:52:37 |
Closed_By | ⇒ | mbabker |
The more I read through PR and comments, the more I see that Email issues are going to stay for while. I don't get it, really :-\
All this PR did was improve the error detection from the PHPMailer API when configuring the message to be sent. Issues related to the actual sending process can't be fixed in Joomla core without subclassing/forking PHPMailer.
Thanks Michael. It is become clearer to me know. The underlaying errors, either ignored, or not reported in the upper class, and the lack of error handling from JMail is difficult to work out.
I'm trying to figure out some random errors on a live website. It is very frustrating not being able to find why the default Joomla contact form is not working, only sometimes. I've read also this closed PR #13339 (comment)
What should I add to the code, to gather error logs?
If I can help adding and testing the code, I would do, and having a large scale live context to validate it ;-)
Turn on debug mode, turn on the debug plugin, make sure it is logging at least the mail category. Since 3.6.0 JMail
has been configured in a way to turn on PHPMailer's SMTPDebug option and have a callback to log error messages.
I've read about JMail and SMTPDebug, that's great. But I've learned again about debug plugin improvements, thanks a million Michael!
I've found the categories allowed, and their syntax. I can leave all, but it will be very verbose on a LIVE website =-0
What should I use for SMTP, PHPMailer and Joomla contact form?
Less possible fatal errors or errors in general regarding mail sending is a good thing for everyone!