Community discussions

MikroTik App
 
Josephny
Forum Guru
Forum Guru
Topic Author
Posts: 1190
Joined: Tue Sep 20, 2022 12:11 am
Location: New York, USA

Unable to send email via smtp.gmail.com

Wed Mar 26, 2025 12:56 am

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.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4694
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

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

Wed Mar 26, 2025 1:57 am

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.
 
Smokeshow
just joined
Posts: 18
Joined: Thu Mar 16, 2017 10:30 pm

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

Wed Mar 26, 2025 4:33 am

Google has been locking this down. Your easiest approach is setting up an app password.

https://wpmailsmtp.com/gmail-less-secure-apps/
 
Josephny
Forum Guru
Forum Guru
Topic Author
Posts: 1190
Joined: Tue Sep 20, 2022 12:11 am
Location: New York, USA

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

Wed Mar 26, 2025 7:50 am

So smtp.gmail.com works on some devices and does not work on others (in different locations).

What do others use for smtp server?
 
User avatar
normis
MikroTik Support
MikroTik Support
Posts: 27052
Joined: Fri May 28, 2004 11:04 am
Location: Riga, Latvia
Contact:

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

Wed Mar 26, 2025 9:06 am

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.
 
User avatar
Amm0
Forum Guru
Forum Guru
Posts: 4694
Joined: Sun May 01, 2016 7:12 pm
Location: California
Contact:

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

Wed Mar 26, 2025 12:16 pm

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.
 
User avatar
Larsa
Forum Guru
Forum Guru
Posts: 1865
Joined: Sat Aug 29, 2015 7:40 pm
Location: The North Pole, Santa's Workshop

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

Wed Mar 26, 2025 1:36 pm

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.
 
Josephny
Forum Guru
Forum Guru
Topic Author
Posts: 1190
Joined: Tue Sep 20, 2022 12:11 am
Location: New York, USA

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

Wed Mar 26, 2025 2:13 pm

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.
 
User avatar
jbl42
Member Candidate
Member Candidate
Posts: 257
Joined: Sun Jun 21, 2020 12:58 pm

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

Wed Mar 26, 2025 2:56 pm

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.
 
User avatar
Larsa
Forum Guru
Forum Guru
Posts: 1865
Joined: Sat Aug 29, 2015 7:40 pm
Location: The North Pole, Santa's Workshop

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

Wed Mar 26, 2025 3:11 pm

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.
 
Josephny
Forum Guru
Forum Guru
Topic Author
Posts: 1190
Joined: Tue Sep 20, 2022 12:11 am
Location: New York, USA

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

Wed Mar 26, 2025 3:25 pm

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").
 
User avatar
Larsa
Forum Guru
Forum Guru
Posts: 1865
Joined: Sat Aug 29, 2015 7:40 pm
Location: The North Pole, Santa's Workshop

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

Wed Mar 26, 2025 3:47 pm

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. .
 
Josephny
Forum Guru
Forum Guru
Topic Author
Posts: 1190
Joined: Tue Sep 20, 2022 12:11 am
Location: New York, USA

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

Wed Mar 26, 2025 4:01 pm

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?
 
User avatar
Larsa
Forum Guru
Forum Guru
Posts: 1865
Joined: Sat Aug 29, 2015 7:40 pm
Location: The North Pole, Santa's Workshop

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

Wed Mar 26, 2025 4:36 pm

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”.
 
Josephny
Forum Guru
Forum Guru
Topic Author
Posts: 1190
Joined: Tue Sep 20, 2022 12:11 am
Location: New York, USA

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

Wed Mar 26, 2025 5:13 pm

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.
 
FIAG09
just joined
Posts: 1
Joined: Tue Feb 18, 2025 8:42 pm

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

Thu Mar 27, 2025 10:03 pm

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
 
User avatar
jbl42
Member Candidate
Member Candidate
Posts: 257
Joined: Sun Jun 21, 2020 12:58 pm

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

Wed Apr 02, 2025 10:41 pm

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.