Page 1 of 1

Unable to send email via smtp.gmail.com

Posted: Wed Mar 26, 2025 12:56 am
by Josephny
I've this working on many devices for years now and all of a sudden I get the error:

Error sending e-mail <355hEX UP to 192.168.0.11>: AUTH failed

Config is:
/tool e-mail
set from=xxxx@yyy.com port=465 server=smtp.gmail.com tls=yes user=xxxx@yyyyy.com
I've searched previous posts and see there are various solutions recommended including: 2FA solution, "apps password", port 587, and a starttls. None work.

I've changed nothing on my google account (I know that doesn't mean google itself hasn't changed anything).

Anyone have a solution?

Thanks.

Re: Unable to send email via smtp.gmail.com

Posted: Wed Mar 26, 2025 1:57 am
by Amm0
Did you upgrade the router at some point? What version is this happening on?

If this was all working and you have not changed version, you may want to check the "app password" specifically in your Google account and confirm it still enabled/not expired/etc.

Re: Unable to send email via smtp.gmail.com

Posted: Wed Mar 26, 2025 4:33 am
by Smokeshow
Google has been locking this down. Your easiest approach is setting up an app password.

https://wpmailsmtp.com/gmail-less-secure-apps/

Re: Unable to send email via smtp.gmail.com

Posted: Wed Mar 26, 2025 7:50 am
by Josephny
So smtp.gmail.com works on some devices and does not work on others (in different locations).

What do others use for smtp server?

Re: Unable to send email via smtp.gmail.com

Posted: Wed Mar 26, 2025 9:06 am
by normis
most email servers now require an app password to be set up. it works with RouterOS, just go into google settings and set it up.

Re: Unable to send email via smtp.gmail.com

Posted: Wed Mar 26, 2025 12:16 pm
by Amm0
So smtp.gmail.com works on some devices and does not work on others (in different locations).

What do others use for smtp server?
smtp.gmail.com is what's documented. Given the AUTH failure, that would indicate you do have the right DNS SMTP server addresss.

Don't post it here, but you might want to confirm all the settings using "/tool/export show-sensative", specifically that a app password, not a google account password, is used. I'm not sure Google even allows anything other than using "app password", see https://support.google.com/mail/answer/ ... 4475223-NC on how to set it up.

Re: Unable to send email via smtp.gmail.com

Posted: Wed Mar 26, 2025 1:36 pm
by Larsa
Just to add to what's already been said: Google has become much stricter to prevent spam and abuse. An AUTH failure might not only mean wrong credentials. It can also happen if the sender is not authorised to send on behalf of the domain used in the "MAIL FROM:" during SMTP. Make sure the sending IP is included in the domain's SPF record. Also check that DKIM is set up correctly and that DMARC is not rejecting your messages due to misalignment.

And yeah, for Gmail, using an app password is typically required nowadays, especially if the device or app isn't able to trigger a single sign-on (SSO) authentication flow.

Re: Unable to send email via smtp.gmail.com

Posted: Wed Mar 26, 2025 2:13 pm
by Josephny
Seems like Google is slowly implementing the "app password" requirement.

I use my regular gmail password in most places.

I just set up an app password and use it now on those devices that require it.

Re: Unable to send email via smtp.gmail.com

Posted: Wed Mar 26, 2025 2:56 pm
by jbl42
Yes, using smtp.gmail.com requires an app specific password which can be created on the gmail web interface.
https://support.google.com/mail/answer/185833?hl=en

It is much better for security, because the APP PW cannot be used to log into to your gmail/google account (if it leaks somehow out of your router config). If leaked or not used anymore, it can be changed or revoked without changing your google/gmail login.

Re: Unable to send email via smtp.gmail.com

Posted: Wed Mar 26, 2025 3:11 pm
by Larsa
Just a quick follow-up to clarify: A Google app password usually works fine out of the box for regular Gmail addresses (like xxxxx@gmail.com). But if you're sending from a custom domain (like xxxx@yyyyy.com), it won’t work unless a proper SPF record is set up for that domain.

Re: Unable to send email via smtp.gmail.com

Posted: Wed Mar 26, 2025 3:25 pm
by Josephny
Just a quick follow-up to clarify: A Google app password usually works fine out of the box for regular Gmail addresses (like xxxxx@gmail.com). But if you're sending from a custom domain (like xxxx@yyyyy.com), it won’t work unless a proper SPF record is set up for that domain.
I use a "Google Workspace" (formerly known as "G Suite" and "Google Apps") account.

This service provides, among other things, <user>@<myowndomain>.com, and are indeed there are SPF DNS records (2 IP4 ip address, and an "include" of "_spf.google.com").

Re: Unable to send email via smtp.gmail.com

Posted: Wed Mar 26, 2025 3:47 pm
by Larsa
If you're sending on behalf of "<user>@<myowndomain>.com" from a new IP address that isn’t part of Google Workspace’s infrastructure, you’ll need to manually add that IP address to your domain’s SPF record. Otherwise, Google (and other receivers) may reject or flag the message as unauthorised.

For example, if you're also sending e-mail from IP address 198.51.100.25, you should update the SPF record to look something like this:

"v=spf1 ip4:198.51.100.25 include:_spf.google.com ~all"

Alternatively, instead of specifying an IP address directly, you can use a domain name that resolves to the correct IP (via an A or CNAME record), such as "mailsender.myowndomain.com". In that case, your SPF record might look like this:

"v=spf1 a:mailsender.myowndomain.com include:_spf.google.com ~all"

Make sure not to duplicate it, just update the existing one accordingly. Also, depending on the TTL (Time To Live in seconds) of the DNS TXT record, it may take some time before changes propagate across DNS resolvers. .

Re: Unable to send email via smtp.gmail.com

Posted: Wed Mar 26, 2025 4:01 pm
by Josephny
If you're sending on behalf of "<user>@<myowndomain>.com" from a new IP address that isn’t part of Google Workspace’s infrastructure, you’ll need to manually add that IP address to your domain’s SPF record. Otherwise, Google (and other receivers) may reject or flag the message as unauthorised.

For example, if you're also sending e-mail from IP address 198.51.100.25, you should update the SPF record to look something like this:

"v=spf1 ip4:198.51.100.25 include:_spf.google.com ~all"

Alternatively, instead of specifying an IP address directly, you can use a domain name that resolves to the correct IP (via an A or CNAME record), such as "mailsender.myowndomain.com". In that case, your SPF record might look like this:

"v=spf1 a:mailsender.myowndomain.com include:_spf.google.com ~all"

Make sure not to duplicate it, just update the existing one accordingly. Also, depending on the TTL (Time To Live in seconds) of the DNS TXT record, it may take some time before changes propagate across DNS resolvers. .
That's a great explanation of how this works -- thank you.

I have been using my regular google email account username and password for all ROS e-mail configurations and it works perfectly. The problems just very recently started and only at 1 or 2 sites.

Are you saying that we have the option of (1) updating or adding another SPF record for where emails will be sent from, or (2) using an app password?

Re: Unable to send email via smtp.gmail.com

Posted: Wed Mar 26, 2025 4:36 pm
by Larsa
Hard to say exactly what’s going wrong, but an easy way to troubleshoot is to run "/system telnet" from a router that's having issues. This guide shows how to Testing SMTP using Telnet.

It’ll let you see where the SMTP process is failing and should give you a proper error message in plain text than just “AUTH failed”.

Re: Unable to send email via smtp.gmail.com

Posted: Wed Mar 26, 2025 5:13 pm
by Josephny
Hard to say exactly what’s going wrong, but an easy way to troubleshoot is to run "/system telnet" from a router that's having issues. This guide shows how to Testing SMTP using Telnet.

It’ll let you see where the SMTP process is failing and should give you a proper error message in plain text than just “AUTH failed”.
Great link.

Will put that on the "to-tackle" list.

Re: Unable to send email via smtp.gmail.com

Posted: Thu Mar 27, 2025 10:03 pm
by FIAG09
I’ve have the same problem and after hours of looking around I found the solution:

In your email account settings (Gmail) go to:
Security> enable 2 steps verification> enter to 2 steps verification

At the bottom you will have “create application password” option, you enter and create a password, use that in the MK as the password account and that’s it

Re: Unable to send email via smtp.gmail.com

Posted: Wed Apr 02, 2025 10:41 pm
by jbl42
I’ve have the same problem and after hours of looking around I found the solution:
Funny how people just do not read instructions: https://support.google.com/mail/answer/185833?hl=en
Google's support page clearly indicates how it works and what to do. It also clearly states 2f authentication is required.