Mail Binding error 2.5.6-2

  • Issue of the topic:I’m trying to set up mail binding so it can send me warning through emails when something irregular happened but it is returning me some error while trying to connect to smtp.gmail.com

My current mail set-up is as this:

mail.things:
Thing mail:smtp:gmail [ hostname=“smtp.gmail.com”, sender="someone@gmail.com", security=“STARTTLS”, username="someone@gmail.com", password=“examplepass”, port=“465” ]

sendmail.rules:
rule “Someone left the office”
when
Item Presence_Phone_Someone changed from ON to OFF
then
val mailActions = getActions(“mail”,“mail:smtp:gmail”)
mailActions.sendMail(“someone@gmail.com”, “someone!”, “someone had left the office.”)
end

The error I receive when reading the log:
[ab.binding.mail.internal.SMTPHandler] - javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1

I’m currently testing the mail binding on my own XPS-Ubuntu 20.04 at the moment.

Thanks for any help or suggestion on how to resolve this. What would be the best way to test my mail and mail rules as right now I’m using network binding with my phone switching on-off to check the mail actions and it is quite an issue setting up for the iOS device as well.

In case you use TLS/STARTLS according to https://support.google.com/mail/answer/7126229?hl=en it should be port 587 instead of port 465.

I will try it and see how it goes