Thank you for doing all these trials but it did not work for me
If I use the “587” as the port in the UI, the code shows port: ’ “587” ’ but the binding ignores it and send the default port (25) which times out.
Here is my thing code entering 587 (no quotes) in the UI
UID: mail:smtp:dd7055cab0
label: SMTP Google
thingTypeUID: mail:smtp
configuration:
hostname: smtp.gmail.com
password: my app password
security: STARTTLS
port: "587"
sender: xxxx@gmail.com
username: xxx@gmail.com
here is the script
val mailActions = getActions("mail","mail:smtp:dd7055cab0")
mailActions.sendMail("xxx@yahoo.com","openhab","Test")
and the error
21:53:52.287 [WARN ] [hab.binding.mail.internal.SMTPHandler] - Sending the email to the following server failed : smtp.gmail.com:587
21:53:52.289 [WARN ] [hab.binding.mail.internal.SMTPHandler] - javax.mail.MessagingException: IOException while sending message;
nested exception is:
javax.activation.UnsupportedDataTypeException: text/plain; charset=UTF-8
If I remove the quotes in the code (port: 587), then the binding thinks it is a real number and sends 587.0 as the port which gives many errors