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)
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)
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.
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.
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
Does blynk only support gmail SMTP server?
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.
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