Fail to send an auth Token via smtp (gmail) from Blynk Server

I try to retrieve an auth token from my Blynk Server via my gmail account but it’s not working

Here is my error logs.

15:12:49.120 INFO - Using data dir '/BlynkServer/blynk'
15:12:49.260 INFO - Using native epoll transport.
15:12:50.898 INFO - Initializing gmail smtp mail transport. Username : a@gmail.com. SMTP host : smtp.gmail.com:587
15:12:51.599 INFO - Didn't find custom user certificates.
15:12:51.604 INFO - Didn't find Let's Encrypt certificates.
15:12:51.604 WARN - You didn't specified 'server.host' or 'contact.email' properties in server.properties file. Automatic certificate generation is turned off. Please specify above propert$
15:12:51.605 INFO - Using native openSSL provider.
15:12:51.606 WARN - ATTENTION. Server certificate paths (cert : '/BlynkServer', key : '/BlynkServer') not valid. Using embedded server certs and one way ssl. This is not secure. Please rep$
15:12:52.968 INFO - Hardware plain tcp/ip server listening at 8442 port.
15:12:52.972 INFO - Hardware SSL server listening at 8441 port.
15:12:52.973 INFO - Application server listening at 8443 port.
15:12:52.974 INFO - HTTP API and WebSockets server listening at 8080 port.
15:12:52.975 INFO - HTTPS API, WebSockets and Admin page server listening at 9443 port.
15:12:52.975 INFO - Mqtt hardware server listening at 8440 port.
15:14:05.313 INFO - Trying register user : x@gmail.com, app : Blynk
15:14:05.351 INFO - Registered x@gmail.com.
15:14:05.673 INFO - x@gmail.com Blynk-app joined.
15:14:25.293 INFO - Creating new dashboard.
15:14:45.932 INFO - x@gmail.com Blynk-app joined.
15:16:24.922 INFO - x@gmail.com Blynk-app joined.
15:16:33.120 ERROR- Error sending email auth token to user : x@gmail.com. Error: Couldn't connect to host, port: smtp.gmail.com, 587; timeout -1
15:18:40.352 ERROR- Error sending email auth token to user : x@gmail.com. Error: Couldn't connect to host, port: smtp.gmail.com, 587; timeout -1

ps. I already turn on my less security application option in my gmail account and I already double check my password. btw I set up my Blynk Server on Digital Ocean.

I try to search many topics in the community but no solution to my issue.

Please help, Thanks

@rikkuzaka do you have a mail.properties file?

Also check in the Digital Ocean settings that the smtp port is open.

@Costas Thanks for your help.

I’m sorry for the late reply.

  1. Yes i have mail.properties file located in the same directory.
  2. I use Ubuntu on Digital Ocean so normally all the port are open. (Correct me if i’m wrong, I’m very new to the OS)

@rikkuzaka one of my cloud based servers runs on Ubuntu and you specifically have to open the port via a control panel.

1 Like

@Costas There is a port management under firewall option in Digital Ocean’s control panel but it’s currently off by default. I will try to open and make some change to it when I’m home.

1 Like

@Costas I try to open all TCP & UDP Ports but so far no luck

Have you restarted the Blynk server since you opened the ports?

Yes i did :frowning:

Does this server require any form of port forwarding?

This is the server site. I don’t think that the server needs any special work.

Usually, this means that something within your network configuration. Here was similar topic - Local server with e-mail time-out error (solved). Did you change something in your droplet? What OS do you use?

No, as far as I know.

I have done anything to this droplet. It’s brand new created for this project. I’m using Ubuntu 16.04.3 x64.

I’m thinking about what you said. Do I have to add these securities to my server first?

The error is pretty clear - google SMTP host is not available either because 587 port is blocked or because you have some firewall enabled. You need to find a reason.

Hello marciomalewschi

To curb a recent increase in abuse and SPAM, DO has an initial SMTP block on new accounts created in certain contexts. If you file a support ticket (https://cloud.digitalocean.com/support) the team should be able to lift that for you after some manual account verification.