Local Server Email will not send

This is weird… I’m sure this worked at one time.

I have the BLYNK server (latest version) running on a Raspberry Pi. All is well.

BUT it won’t send me an email.

So - if I go to a terminal in the PI and use the command line mail program - it sends me email no problem. I’ve set up the SMTP program with my gmail details and all works a treat.

Here’s what I’ve put in the mail.properties file - which is in the same directory as the other BLYNK stuff (with 777 permission)


Clearly I’ve change the password here.

When I try from the APP - which is working fine, to send an email to save me typing in a long AUTH token, I get…

“Email was not sent to your login acc. Please check your network connection”.

But everything is working - the APP is working and talking to the local server, as above, the Pi can send emails out - what am I missing here?

Please check “logs/blynk.log” and “logs/users/your_email.log” for error. And post it here.

Oh dear… looks like I’ve messed that up.

So the logs did not seem as if they’d been updated for while but were quite big from experimenting. So I deleted logs/blynk.log and logs/users/pete@scargill.org.log.

They didn’t come back to I rebooted the Raspberry Pi hosting BLYNK. All is working (except for the email) but neither of these logs appear to be re-creating.

So I guess the first questions are - how do I get the two files to recreate and is that deliberate or a bug that they are not being recreated? (yes, I’ve hit refresh - definitely not there)

I think logs were created, but probably in some other folder (in folder you was running jar file from).

I run the jar files in /var/blynk - and I’ve checked everything from there in. They are not there…

So this is what I have at startup…

java -jar /var/blynk/server-0.10.2.jar -dataFolder /var/blynk &

So as you can see - the logs SHOULD be getting created/recreated in /var/blynk.
I’ve just opened the app, turned a light on and off, tried and failed to send myself an email and…

No Blynk log and no email log… I wondered it logging out of and into the app might affect this - no - still no logs.

Mmm… Ok please restart server. Check there are no more java processes anymore. Start again. No errors? No logs?

I did that - I resrtarted the whole Raspberry Pi - and just to confirm - the /var/blynk directory and those below it have 777 privilege - there is no reason that the logs should not be recreated that I can see.

Any ideas?

I suppose you are using “server.jar” to run server. If it is so then you should edit mail.properties included in the .jar archive. Mine working fine after i did the same.

Hi Dmitriy
I got the same problem, the local server can’t send out emails.

Here is blynk.log
===============================BEGIN OF LOG============================================
2017-02-05 18:03:59.525 INFO - Using data dir ‘/opt/Bdata’
2017-02-05 18:03:59.719 INFO - Region : local
2017-02-05 18:03:59.994 INFO - Initializing gmail smtp mail transport. Username : auth@sunplant-mis.com. SMTP host : smtp.exmail.qq.com:465
2017-02-05 18:04:00.260 WARN - Found server certificates but no client certificate for ‘/opt/blynk-server’ path. Using one way ssl.
2017-02-05 18:04:00.353 INFO - Hardware plain tcp/ip server listening at 8442 port.
2017-02-05 18:04:00.353 INFO - Hardware SSL server listening at 8441 port.
2017-02-05 18:04:00.353 INFO - Application server listening at 8443 port.
2017-02-05 18:04:00.354 INFO - HTTP API server listening at 8080 port.
2017-02-05 18:04:00.354 INFO - HTTPS API server listening at 9443 port.
2017-02-05 18:04:00.355 INFO - HTTPS Admin UI server listening at 7443 port.
2017-02-05 18:04:00.355 INFO - Web Sockets server listening at 8082 port.
2017-02-05 18:04:00.355 INFO - Web SSL Sockets server listening at 8081 port.
2017-02-05 18:04:00.355 INFO - Mqtt hardware server listening at 8440 port.
2017-02-05 18:04:23.834 INFO - marketing@sunplant-china.com Blynk-app joined.
2017-02-05 18:07:58.288 WARN - No order field ‘id’
2017-02-05 18:08:27.539 WARN - No order field ‘id’
2017-02-05 18:08:32.901 WARN - No order field ‘id’
2017-02-05 18:55:02.246 ERROR- Error sending email from application. From user marketing@sunplant-china.com, to : marketing@sunplant-china.com. Reason : Exception reading response
==================================END OF LOG==========================================

here is mail.properties
=================================BEGIN OF FILE==========================================

and I have some questions

  1. Does blynk only support gmail SMTP server?
  2. How to specify the SSL or TLS etc.

if there is any debug mode can give more information to help solve the problem plz let me know thx.

No. In fact we do not use gmail. Maybe your provider requires some additional configuration?

This should do that:

@InitX have you “certified” your server as per the docs?

thx Dmitriy could you tell me where can I find the full example of mail.properties file

ok , its seems I had got the full parts already.

Your provider should have examples of how you could reach them from code. Do you have such?

Hi Dmitriy I had figure out the problem,
I switch another mail server use normally smtp protocol with 25 port,
then the mail system is working correctly. after I switch back and use smtp with 25 port and set
mail.smtp.starttls.enable=false every mail was sent immediately.
Like you said maybe this mail server need some additional options or other parameters.
Sending mail is an important procedure in blynk I purpose add more parameters in it :slight_smile:

2 posts were merged into an existing topic: Need help with local server installation on raspberry pi 3