Formit emailFrom settings

Hi all!

I have a little site which has a simple contact form via Formit.
The emailFrom setting is - the same domain as the website.
The client has taken their email for this domain into a gmail Workspace account.
Since them, formit has stopped delivering the notification emails from formit to anyemail address at this domain.
I added a personal gmail account to the emailTo list, and that does come through, but with a spam warning.

I have spf records setup on the DNS server for the webhosting server.

WHat do you guys use to get email notifications through?

I tried setting up SMTP settings in modx, but that delivers nothing, and the formit page hangs and doesn’t execute.

Any ideas

You will 100% need to either send through a real user via SMTP, or send via a third-party SMTP mailing service and configure SPF, DKIM, etc correctly to ensure delivery.

Use Bob’s QuickEmail package with &debug=`1` to get a better look at why it may not send correctly. Probably need to try different ports, or tweak other settings. For Amazon SES, here are settings I’ve personally verified.

Sending through a Gmail SMTP account now requires that you set up an App code through Google. This is from the docs of SPForm (which you might consider as an alternative to FormIt for a simple contact form):

**Important Note**: For Gmail, if you use two-factor authentication (and you should), Gmail now requires you to create an [App password](

1. Click on "Select app" and select "mail"
2. Click on "Select device" and select "Other (*custom name*)"
3. Make up a name for your device
4. Click on the "Generate" button
5. Copy the generated password at the upper right
6. Paste that password into the `mail_smtp_pass` System Setting

If you change your Gmail password, any App passwords are revoked, and you have to recreate them.

Also from those SPForm docs, here are the SMTP settings I recommend for sending through Gmail:

These are the ones to set (consult your hosts help pages or email support for the Host specification and SMTP port number). These settings work with Gmail:

mail_smtp_hosts — The host SMTP specification (e.g.,
mail_smtp_port — Your hosts SMTP port number, 465
mail_smtp_auth — set to Yes
mail_smtp_prefix — ssl
mail_smtp_user — The username for your email account, your Gmail address
mail_smtp_pass — The password for your email account (see App password note above)
mail_use_smtp — Set to Yes

In some cases you may need to use port 587 and TLS instead of SSL.

1 Like

I should also mention that, unless you are sending a lot of messages, Mailgun is a good alternative. It pretty much insures that nothing will end up in the spam folder and it costs almost nothing for light users. I send a fair number of messages using Notify and every 6 months or so, I get a bill for about $1.

The MailgunX class (included in the Notify extra) is a PHP class for sending email though Mailgun with MODX.

1 Like

OK thanks Bob - will take a look at Mailgun

Thanks Mark - experimenting now!

That would make a fine addition to Sending mail - Building Sites | MODX Documentation :wink:

Done ---------------------------!


Excellent. This is a great help to many I’m sure!

As far as I can tell, the steps to create an app password no longer work, although Google still lists them in their docs. Google says to go to Account (profile Icon) and select “App Passwords.” The “App Passwords” option no longer appears on the “Security” panel and I was unable to find it anywhere. Nor could I find a place to click on “Select App.”

If any one finds a way to do this, let me know and I’ll update the docs.

Just wanted to share, that you could also send an email to:

You open the site, and it will generate a random email-address.
Take that address and put it in your formit-call as &emailTo (just for testing purposes).
Send an email through the form, then switch back to the mail-tester and click “Then check your score”.

It will present you with a list of successful and failed tests,
and you then should act according to their recommendations :+1:t4: