I have been trying to understand and diagnose an email sending problem with the contact form widget.
Guided by your forum, I installed “WP Mail Logging” plugin to get the report info when emails send, including error messages and content.
First, I received “Could not instantiate mail function” error. I had to follow the phpmailer guidelines and finally discovered my server did not have `sendmail` installed. It turns out Phpmailer is a library wrapper for sendmail. On the linux-based server, I installed it:
sudo apt install sendmail
Next, using ‘Easy WP SMTP’ (phpmailer), I could send test emails via authenticated Gmail SMTP server, and it will appear in the recipient’s inbox. Great.
Next, the Contact Form Widget would send an email, but not be received:
– it successfully showed the “Thanks” page after clicking submit.
– the sent email appeared in the “WP Mail Logging Log” list
– the sent email showed in my Gmail “Sent mail” list.
– but the email did not arrive in the To address’s Gmail inbox.
I discovered that if I use the same From and To addresses (even though the To is a forwarded address), the email was not received. Possibly blocked by Gmail or blocked by Domain host forwarding.
My ongoing problem is now solved.
Hopefully someone in future will benefit from this experience.