Can't get FormIt form to send

Hi Guys,

I’m having trouble setting up Google G Suite SMTP emails in modx. I’ve tried adding the setings to the SMTP settings in modx and i’ve installed Quick Email but i’m getting an error.

Send Failed
Mailer error info: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

The website is hosting on a Cpanel reseller account. Ports are open in fire wall.

I’ve used the settings in this article: https://support.modx.com/hc/en-us/articles/216758738-Sending-Email-with-your-G-Suite-or-Gmail-Account

Previously i’ve tried using SendGrid ESP to send emails but still having problems.

Thanks in advance.
Mike

Is that the output of QuickEmail with &debug=`1` ? That should be more explicit about what part of the connect it fails on (but be careful about posting that, because it may include your username/password).

Could just be that you need to try different ports.

I’ve added the shortcode [[!QuickEmail? &debug=1]] and i still get the same info. Cleared cache and put cloudflare in dev mode also.

Sorry if I gave the wrong impression. Adding &debug=`1` would not fix it, but should’ve shown you more debug information than what you’ve posted here to clarify what part of connecting went wrong.

Debugging email is tricky without all the information. For all we know there’s a typo in the username or the smtp host, or the server blocks outgoing (note: CloudFlare is incoming) traffic.

I’ve definitely used Google Suite SMTP before so MODX can handle it, but you may need to fiddle with the settings and use QuickEmail’s detailed debugging to see if it gets to the mailserver (means host, connection prefix, and port are correct) and if the username/pass are vallid (e.g. if you use 2FA, you need an app password).

From the message SMTP connect() failed I suspect it’s not getting to the mailserver yet, so the host, prefix, or port are not accepted. Try port 587 instead of 465 for example, and connection prefix tls instead of ssl.

hi @markh

Sorry i didnt give enough detail. I placed the full quickEmail snippet into the resource but it wasnt showing any more info on the quickEmail page. Until i manually cleared the cache!

Now i’ve got a page full of info. The main issue looks to be that the username and password were not accepted. SMTP ERROR: Password command failed and SMTP Error: Could not authenticate.

I know the credentials i have used have been input correctly.

I will look into an app password for 2FA but i did dissable 2FA a few days ago for the purpose of diagnosing this issue. I’ve found a link to using Gmail as an SMTP relay at this link, i’ll let you know how i get on.

If you can think of anything else to help i would greatly appreciated.

Thanks for your help so far @markh

1 Like

Hi @markh

I got it to work in the end. I followed the guide on this link:

https://support.google.com/a/answer/2956491?hl=en#zippy=,turn-on-comprehensive-mail-storage

I also enabled 2FA in G suite settings and i setup an app password.

I also had to change the SMTP settings to smtp-relay.gmail.com, TLS port 587

The next problem i have is the formit form not sending but i’ll reseach the issue first and start a new threat if required.

Thanks for your help

Mike

1 Like