How to debug email settings
What to do if site is not sending emails.on Thursday 11 October 2018
How to debug not sending email problem
With e107 you have more options how to check if your emails are sent.
One setting is in classic main preferences - default is php method
Second setting is in Mail preferences under Users related stuff - default is smtp method
And some plugins could use their own way how to send email.
e107 itself has test buttons for checking if emails are sent. Problem starts when you got no errors and your email never come.
Mail snapshots logging
So what to do? First help: DEBUG. If you got this help answer with email related question, it means that you should use inbuilt mail logging functionality. If you use Developer mode too, it's bonus to it.
So: how to initiate mail logging? Go to User tab and select option Mail / Preferences.
You can select if you want to send email or just make snapshot of it.
Test email from Preferences
Settings / Preferencies / Email & Contact Info
If you get this message (green), it means that e107 works correctly, you have problem with you mail server.
Open file mailoutlog.txt under your e107_system/hash/logs directory:
and find your email there.
In my case: Error info: Could not instantiate mail function.
Test email from Mail preferencies
With this option you got error in your admin area directly:
If you have debug on (as browser addon in my case), you get full debug info in admin area.
So only solution is set SMTP connection (on both places).
I was sure that my smtp settings was correct. Without logging I wouldn't know that it was blocked by my hosting because their spam policy. I needed to change From address to adress registered on their hosting. The option to test SMTP connection worked only for port 25 (there is already issue about this on github, I don't use latest version, maybe it is fixed now)
Error info: SMTP Error: data not accepted server error: DATA END command failed Detail: Blocked, unknown email address in envelope-sender or From header. http://antispam****x?from=***&sender=****
From address is set in Email address for emails under Site preferences.
It looks like this helped.
So now I am able to send emails from localhost too.
Notification emails check
Next area you should always check is sending notify emails. In Notify Tools you can do it very easy. Sometimes (mainly on localhost) I got white page after clicking on Test email, but it needs only to refresh page.
In this case notification emails are sent to exact userclass, so if it's not you, set logging without actual sending emails. You will find result in your log file:
Send to admin at *** Mail-ID= - Success
After plugin installation - check Notify tools - if plugin is listed there, it uses new Event manager for mail sending.
If plugin is not there, it uses classic way and you have only one option - set logging on, simulate action and then check mailoutlog.txt file.
In my case with survey plugin: