Formit not emailing forms on IONOS shared hosting

On an Ionos shared hosting server, I have a form using Formit to email the form and use the formit2resource hook to create a resource. The resource is getting created, but no email is being sent out. No errors are being generated in the logs either.

What is the best way to troubleshoot the issue?

Formit call is:

[[!FormIt? 
&hooks=`formit2resource,email,redirect`
&resource2formitfields=`parent,pagetitle,description`
&emailTpl=`fiEmailTpl`
&emailSubject=`A new suggestion submitted.`
&emailTo=`email@domain.com`
&emailFrom=`[[++emailsender]]`
&redirectTo=`1234`
]]

Do you have SMTP enabled?

By default MODX uses the PHP mail() function to send E-Mails, which may be blocked by your hosting provider.

For more information take a look at the MODX documentation here.
There is also more information about sending emails here. (This information is for MODX Cloud, but parts of it apply to every MODX installation.)

For troubleshooting you can use the QuickEmail extra.

SMTP was not turned on. So after turning that on Google Workspace is rejecting the username and password for some reason.

No idea why, yet.

If you have two-factor auth. turned on, Google requires you to set up an app passcode to use STMP through your account there.

Two factor isn’t enabled for this system. In addition the particular email account being used has the “Less secure app access” feature turned on. Still can’t figure out a reason why it would be rejecting the email.

(For anyone using “Less secure app access”, Google has a note stating that the feature will be completely removed in January 2025.)

So it seems like even if I got this to work today it will fail in a couple months.

You probably need to set up DKIM at ionos - it’s not set up ‘out of the box’. I’ve never had any luck with emailsender being a gmail address. I now tend to set up an email address just to handle the form such as myform@myionosdomaindotcom. Making sure the domain has DKIM, Dmarc and SPF. I can send to gmail with no problem when those settings are in place.

I haven’t looked into DKIM yet, but how would that work with mail servers at Google Workspace? Can you setup email in both places on the same domain?

It might be worthwhile looking at a third party ESP such as SMTP2Go, SparkPost, Postmark or similar as they all still support SMTP but it will require domain validation and possibly server IP limting access.

In addition, you’ll need to make sure the host doesn’t have any of the outgoing ports blocked. Some hosts block common mail ports to prevent automated spam bots that would use port 25.

My advice would be to keep it simple and not try to interact with google. If necessary, register another domain in the same account and set up spf, dmarc, dkim and send from that, to your destination - don’t publish that email address anywhere. If you ever manage to send from an email address that is in any way linked to google please do let me know how you did it. I’ve done exactly what I’ve just described and found it to be the only way that works.

The customer went with a second domain name. That seems to be working.

1 Like

This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.