Mail binding returning java errors

Hi everyone,

I’m struggling to get my OH 2.5.0-1 to send an email notification.

I have setup the Mail binding as follows:

Thing mail:smtp:icloud [ hostname=“smtp.mail.me.com”, sender="xxx@icloud.com", security=“TLS”, port=“587”, username="xxx@icloud.com", password=“yyy” ]

I have setup a simple rule to send an e-mail notification:

val mailActions = getActions(“mail”,“mail:smtp:icloud”)

rule “send test mail”
when
Item EnoceanSwitchSalon_PushButton changed from ON to OFF
then
mailActions.sendMail(“zzz@mac.com”,“Test subject”,“Hello world”)
end

Here is the result in the log:

2019-12-29 16:42:01.104 [ome.event.ItemCommandEvent] - Item ‘EnoceanSwitchSalon_PushButton’ received command OFF

2019-12-29 16:42:01.118 [nt.ItemStatePredictedEvent] - EnoceanSwitchSalon_PushButton predicted to become OFF

==> /var/log/openhab2/openhab.log <==

2019-12-29 16:42:01.137 [WARN ] [javax.mail ] - expected resource not found: /META-INF/javamail.default.address.map

==> /var/log/openhab2/events.log <==

2019-12-29 16:42:01.143 [vent.ItemStateChangedEvent] - EnoceanSwitchSalon_PushButton changed from ON to OFF

==> /var/log/openhab2/openhab.log <==

2019-12-29 16:42:03.333 [WARN ] [ab.binding.mail.internal.SMTPHandler] - Trying to send mail but exception occured: Sending the email to the following server failed : smtp.mail.me.com:587

The smtp setup should be OK, as I’m sending notifications from another application on the same RPI without any issue.

Anyone have an idea how ti fix or troubleshoot?

Regards, algol

Mail action has been replaced by a new version in 2.5 You may need to uninstall the binding, stop OH, clean the cache, restart and install the newest mail action binding.

I started to use the Mail add-on newly in OH 2.5. Mail binding is 2.5. Never installed Mail Actions in previous releases .

I did the following:

  1. Installed Mail Actions (1.x add-ons)
  2. Uninstalled Mail Actions (sale as above)
  3. Removed my smtp configuration from my things file,
  4. Uninstalled the Mail binding
  5. Cleared caches
  6. Restarted OH
  7. Installed Mail binding
  8. Created the smtp Thing in Paper UI

It’s a bit voodoo, but redoing things in the right order resulted in things working!

Cheers, Arnaud

Glad to hear it working.

Please click the square box on the post with solution to mark topic as solved.

Thanks