Website Email Sending Failures

Summary

This is most likely not a MODX issue - however, I would really appreciate your thoughts.

Emails will only be sent from the website using the host’s own email addresses. When I use my actual domain email address, which uses Google Workspace, nothing is received.

Step to reproduce

Change the Formit recipient address or the QuickEmail (via System Settings emailsender setting) address to my website’s email eg myname@mydomain.co.uk and send an email. No errors are shown but nothing is received.

Change the Formit recipient address or the QuickEmail (via System Settings emailsender setting) address to another of my domains which is set up with the host (no Google etc) and the emails come through.

Expected behavior

I would expect the emails to be received by my domain’s email address on Google. All other (normal - not from the website) emails are received.

Environment

Latest MODX.
Google Workspace with SPF set up with my host’s IP included.

So do you use SMTP (system setting mail_use_smtp = “Yes”) to send the E-Mails with MODX?

https://docs.modx.com/current/en/building-sites/sending-mail

Sorry, should have included that detail.

No, I have that as disabled as each time I try to enable SMTP I get cannot connect errors using smtp.gmail.com and my domain email/password.

2024-06-03 11:03:27 SMTP ERROR: Failed to connect to server: Connection timed out (110)

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

Did you try using the settings from this article?


Also ostensibly Gmail now requires an “App password”:

Yes, used those settings and have also created and used an app password with the same error message on QuickEmail.


It may be worth nothing that, as of this year, most providers, including Google, require SPF, DKIM and DMARC to be set up before they will deliver any emails from a domain.

Thank you but those are already set up and appear to be working. I’m scratching my head!

It seems like there are two issues - SMTP connection and the receipt of emails to my Google Workspace email. No idea how to fix either!

I don’t think Gmail allows using it effectively as an ESP any longer (and I think Microsoft has also followed that lead, too). They’re going down the path of requiring OAuth 2.0 authentication soon if not already.

Go grab a free account at smtp2go.com, or a paid account you can use for all your sites at postmarkapp.com, you’ll be so glad you did!

Thanks for this.

I have created an account on smtp2go and still get the error on my site - however, using an smtp test tool using the exact same details I get the email. Does this mean it is MODX or my host where the issue lies?

Sounds like an issue with your web host. Possibly try another port as many hosts will block port 25.

I have selected the SSL port 465.

I’ve reached out to my host who I hope will help! Thanks for everyone’s suggestions.

I had the same problem trying to send email through Postmark a while ago. I had to get my web host to whitelist connecting to their IP numbers.

At last! I have it working!

I spoke to the host who suggested using localhost as the SMTP server (I didn’t know that was an option/enabled) which connected and worked. Then I assume because I had entered the server IP into the SPF record it was delivered successfully.

Thank you all for your continued help.

Now that your email is working you can use this site to test its deliverability:

This has shown some areas for improvement, thanks for the link!

1 Like