Mail binding 2.5.1 Error

I am trying to use mail binding to send emails when a switch is triggered
But I am repeatedly getting an error

2020-01-24 11:48:04.889 [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

My rules file:

rule “example”

when

Item DemoSwitch received update ON

then

val mailActions = getActions("mail","mail:smtp:3dc13829")

mailActions.sendMail("xxxx@gmail.com","from openhab","message")

end

My mail.cfg file
// The SMTP server hostname, e.g. “smtp.gmail.com

hostname=smtp.gmail.com

port=587

mail:username=xx@gmail.com

mail:password=xxxxx

from=nsarayu99@gmail.com

tls=true

//ssl=true

popbeforesmtp=false

Please do help me on the issue
Thanks in advance

You should get a DEBUG log.

My first guess is you need to allow access from “less secure apps”. Try this link.

mail.cfg is not used any more. It’s all in the thing config.

Yes, I tried, but I’m getting another error
2020-01-25 03:05:00.309 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘example’: ‘sendMail’ is not a member of ‘org.eclipse.smarthome.core.thing.binding.ThingActions’; line 7, column 5, length 78

I restarted the openhab
I uninstalled and reinstalled the mail binding

but still I am getting the same error

The “not a member of ‘org.eclipse.smarthome.core.thing.binding.ThingActions’” has been very painful for me too. Some things to try:

  1. Make sure the old 1.x Mail Action is removed

  2. Clear the cache and restart openHAB

  3. Reboot

  4. Repeat 2 and 3 as needed

This very finicky for some reason. Once you get it going it works well, but any changes and it can stop working. It stopped again for me on the 2.5.0 to 2.5.1 update. Steps 2 and 3 got it going again.

I am getting the same error for pushbullet binding also
2020-01-25 04:58:06.066 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘example’: ‘sendPushbulletNote’ is not a member of ‘org.eclipse.smarthome.core.thing.binding.ThingActions’; line 6, column 5, length 125

This is the rules file for pushbullet binding.

rule “Send message via Test Switch”

when

Item DemoSwitch received update ON

then

sendPushbulletNote("sarayu", "Thomas, the switch is on!")

end

Your openHAB is likely still setup to use the old action from v1 in both of these cases.
As @jswim788 already said make sure it is removed. Double-check addons.cfg and use Karaf console to display what mail/pushbullet bundles are loaded.