test email not working with gmail

Hi,

i am also having problems,

i have read this thread and it still dont work:

when i try send a email in log it says:

abnormal termination (timeout)

im in SA i dono if that makes a diff?

It should work, just follow these steps:

  1. Configure gmail to use https mode: Settings → General → Browser connection: Always use https
  2. Configure RouterOS email settings:
/tool e-mail
set from=example@gmail.com password=<password> server=74.125.127.109:587 username=example@gmail.com
  1. When sending email from RouterOS, use these settings:
/tool e-mail send to=example@gmail.com body="Example" subject="Example" tls=yes

gmail :

Gmail Help - IMAP = http://mail.google.com/support/bin/answer.py?answer=77659
Gmail Help - POP3 = http://mail.google.com/support/bin/answer.py?answer=76147

it show which port number will be used.

actually … i didnt know which one is gmail/google ip used for email (ive tried block all google ip, but still some pc can browsing google.com). so use domain name.

Sorry, I’m a bit confused…
if you have your own g-mail account (x example AdamSendler[at]gmail.com, with your password “H3r0” and your username for login “AdamSendler”), must Mikrotik use your login credentials to send e-mail through g-mail smtp server… (I think yes, so everyone could make spam using Mikrotik).
Then, the name of sender, must be the e-mail owner (in this case “AdamSendler@gmail.com”) or could you put “RB433_Mt_Everest@gmail.com”?

I don’t know why, but it doesn’t work…

My account: crs[…]@gmail.com

I placed the configuration on Thunderbird and it works correctly:
smtp.googlemail.com (solved as 173.194.70.16) on port 465 with TLS

[admin@VLAN_Sede] /tool e-mail> print
   address: 173.194.70.16
      port: 465
      from: crs*******@gmail.com
      user: crs*******@gmail.com
  password: *****
[admin@VLAN_Sede] /tool e-mail>



send to=crs********@gmail.com subject=test body=hello tls=yes port=465

I see on log Error sending e-mail: error connecting to server.
I also tried to change IP address and port, but the same.

I send email using gmail using port 587 with TLS:

http://support.google.com/mail/bin/answer.py?hl=en&answer=13287 says:
Outgoing Mail (SMTP) Server - requires TLS3 or SSL: smtp.gmail.com (use authentication)
Use Authentication: Yes
Port for TLS/STARTTLS: 587
Port for SSL: 465

Server: 173.194.69.109

If I insert “smtp.gmail.com” it says “Error in Server - ip address or ipv6 address expected!”
173.194.69.109 is the solved DNS for smtp.gmail.com.

Port: 587
From: crs******@gmail.com
User: crs******@gmail.com
Password: *****



send to=m******@tim.it subject=gigi body=tttt t
ls=yes

Same error connecting to server.

I tested that with the ip you used, and mine sent the email.

/tool e-mail
set server=173.194.69.109:587
set from=myuser@gmail.com
set username=myuser
set password=mypassword

hi i have 2 mik with same email config, one of them work fine with gmail, but another not work!
why?
i checked 2rd and it can send email to my email without any problem, but cannot send backup!

HI folks,

I have been trying to send email from my Mikrotik RB951 router using the gmail smtp server. It appeared not to be working even though I could send email from Thunderbird using the same gmail account. Well, guess what? There is a setting in the “my account” section of the gmail account that allows you to send email from a “less secure” source which, in this case, happens to be the RB91 router.

In order to set the gmail email server to send from a “less secure” source, go to your gmail account using your web browser. Click on your profile photo in the upper-right corner of the web page. If you haven’t uploaded a profile photo, there will be a circle with a “D” in the middle of it. In the dialog box that appears, click on “my account”. You are now in the “my account” page. Under “signing in and security”, click on “Signing in to Google”. Scroll down to the bottom of the web page and notice “Allow less secure apps: OFF” . Click on the button to the right and you should now see “Allow less secure apps: ON”. You are now ready to set up your RB951 to send email from the gmail smtp server.

From the command line in Windows, OS X, Linux or Unix, type:
ping smtp.gmail.com
The IP address that you see is the one you will use to configure email in the RB951 router.
Access the RB951 router using Winbox. Click on Tools and choose “Email Settings”. In the dialog box that appears enter the following data:
server:
port: 587
Start TLS: yes
From: @gmail.com
User: @gmail.com
Password:

Be sure to click on “Apply”, the “OK”.

You are now ready to send email from the RB951.

I hope this helps.

Regards,
donjames

I sure wish I could find those setting. When I click on “Signing in to Google”, I get one section for Password and sign-in method with Password, 2-Step Verification,and App passwords. Below that is Account recovery options. That has Recovery email, Recovery phone, and Secret Question. That’s it for Signing into Google. Below that is a section for Device activity & notifications, and another section for Connected apps & sites. Nowhere on the page is anything about less secure apps.

Jim

Hi Jim,

Scroll further down the page and look in the section, “Connected apps & sites”. “Allow less secure apps” is the last entry in that section.

Don

Not there. All I have in that section is sub-sections for “Apps connected to your account” and “Saved Passwords”.
UPDATE!
On my primary personal G-Mail account I have 2 Factor Authentication turned on. When 2FA is on, the Allow less secure apps is not shown. I just logged into a different G-Mail account that does not use 2FA, and Allow less secure apps is allowed on that account.
To confirm all that, I just logged into several other G-Mail accounts (between personal and work I have access to something like 10 of them). Some of the accounts have 2FA set up and some do not. Every account with 2FA would not show the option for less secure apps. The accounts that do not use 2FA, have the option for less secure apps. So I think that’s the answer. As a general rule, I prefer to use 2FA, but will have to try using one of the accounts that is not set up for 2FA.

Hi Jim,

Please let me know if you can get it to work.

Thanks,

Don

Well, I got it working - finally. Tried all kinds of stuff. Tried G-Mail, my ISP’s server, and even my own mail server. From router #1 which connects to the LAN for my server, I could send mail via the local LAN IP address, but not the public IP from either router. I know that an external device can send mail via my mail server, so I knew the ports were open to the server on router #1. When sending to my own server, I had the advantage that I could look at the server logs to see if anything was getting to the mail server - and there wasn’t when it failed. Started thinking it might be a firewall issue. Looked at my firewall rules in the input chain and found the answer. I was very specific on what was allowed on the input chain, and anything else was dropped. I did not have a rule allowing established and related connections in the input chain - DUH! Had not been an issue before as there was not any other router generated outbound traffic other than items that would have specifically allowed return path.

Working fine now!

Jim

Hi Jim,

That’s great! I think we finally solved the mystery of how to send email from a Routerboard using the gmail smtp server. There has been a lot of discussion on this forum about this.

Don

for your information…from ros 6.33 and up there is no reason to resolve smtp.gmail.com

What’s new in 6.33 (2015-Nov-06 12:49):
*) email - allow server to be specified as fqdn which is resolved on each send;

thank u mikrotik for this nice feature :wink:

I tested the email using smtp.gmail.com and it does work. Thanks for the update.
Regards,
Don

I updated one of my routers to 6.34 (from 6.25) this morning, so I will also give it a try…


Sent from my Droid Turbo via Tapatalk, so blame any typos or spelling errors on Android

Hi Jim,
Be sure to update your routerboard firmware. I have an RB751 that was running firmware version 3.24 and would not send email. I updated it to firmware version 3.33 and RouterOS version 6.34.5 and now it sends email. It would also not set the clock with a query to an NTP server.
Don

Updated firmware to 3.33 and ROS 6.35.4 Working fine on both routers now!
Jim