[SOLVED] Mail binding - error sending email


After upgrading to 2.5,1 stable, I am trying to use the new Mail binding. I do not have the old Mail action installed. The Mail thing is green.

When I try to send an email using the sample from the official example I get the following error

2020-02-22 23:18:37.347 [WARN ] [ab.binding.mail.internal.SMTPHandler] - Trying to send mail but exception occured: Sending the email to the following server failed : smtp.gmail.com:587

The rule contains the following

val mailActions = getActions(“mail”,“mail:smtp:gmailserver”)
mailActions.sendMail(“xxxxx@yahoo.com”, “test title”, “test email”)

I have set the logs to DEBUG for the mail binding but no extra messages are being generated when the above rule is triggered

Before I was getting the error

2020-02-22 22:37:38.232 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘rule for testing’: ‘sendMail’ is not a member of ‘org.eclipse.smarthome.core.thing.binding.ThingActions’; line 12, column 3, length 162

but it has disappeared after a restart of openhab

I have enabled the 3rd party access in google settings but I am not sure this is required

Anybody has any idea what is wrong ?

Edit: Solved. It turns out that the 3rd party access in google settings is still required. I thought I had it enabled but I had done it for another google account, not related to the account configured in openhab.

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.