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)

mail.smtp.auth=true
mail.smtp.starttls.enable=true
mail.smtp.host=smtp.gmail.com
mail.smtp.port=587
mail.smtp.username=techscargill@gmail.com
mail.smtp.password=XXXXXXXX

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==========================================
mail.smtp.auth=true
mail.smtp.starttls.enable=true
mail.smtp.host=smtp.exmail.qq.com
mail.smtp.port=465
mail.smtp.username=auth@sunplant-mis.com
mail.smtp.password=xxxxxxxxxxxxxxx

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