Sending email through Gmail inside MODX?

Is there any way to send mail through Gmail through MODX, using the generic SMTP system settings? I think Gmail requires OAuth connection, yes?

Alternatively, has anyone successfully updated their domain SPF records to authenticate email sent through the MODX Cloud servers with an email address at the website domain as the sender?

OAuth is not required, but if the Gmail account as 2-factor authentication, you need to create an “app password” with Gmail.

Either way, it’s definitely possible, though it can be frustrating to set up.

Another way to go is Mailgun, which is very cheap unless you’re sending a ton of emails. Mailgun has docs that walk you through setting up SPF, DKIM, and DMARC records. With Mailgun, your emails are much more likely to avoid the spam folder and you also get good statistics on stuff like who has opened your email.

Or you can use the Notify and Subscribe extras if they fit your use case and get built-in Mailgun capability.

While it’s entirely possible to do this in MODX Cloud using SPF either by IP or a record match, but we strongly discourage using PHPMailer in MODX Cloud as it’s nowhere near as reliable as SMTP whether it’s a third party service such as Mailgun, Postmark, etc, due to the fact that there’s reporting and they have a higher standard of spam protection.

Despite the work we do (at MODX Cloud) to keep our IPs off spam lists, there’s always a chance someone’s site forms will be used for spam and this will often prevent email from reaching inboxes. If email is important to your site’s users, SMTP and a third-party ESP is ideal.

This is for a client, and they’re not going to add a third-party ESP.

It wouldn’t be a ton of email, just sporadic notices going out to a few people.