OH2 Mail Binding set up

Tags: #<Tag:0x00007f5ca655f6b8> #<Tag:0x00007f5ca655f5f0> #<Tag:0x00007f5ca655f500>

I know I have other issues after my upgrade the other day…and I’m working them on another thread.

The upgrade was:
From:
OH 2 on a raspberry Pi. (openHAB 2.5.0~S1566-1 (Build #1566))
To:
openHAB 2.5.0~S1645-1 (Build #1645)

It is possible those other errors are the cause of my rules, that send mail, being broken. But, in the mean time, since I changed from the old 1.x action sendMail to the new 2.x binding, I wanted to confirm I’ve got the setup right. I have done more than one shutdown and cache clear. Another caveat, the 1.x action was installed when I did the upgrade and the 2.x binding was installed before the action was removed.

Currently any time a rule sends mail I get the following:
The name 'sendMail' cannot be resolved to an item or type

My thing file is thus:

Thing mail:smtp:Gmail [ hostname="smtp.gmail.com", sender="<mygmail>@gmail.com", security="TLS", username="<mygmail>@gmail.com", password="my password" ]

A sample of the offending rule:

...
...
	val mailActions = getActions("mail","mail:smtp:Gmail")
	mailActions.sendMail(mailTo, "Motion Detected", message)
...

I’ve read the wiki and a couple of threads here…not sure I got it right. But, it seems to me the error is caused by something other than my thing or rule. But, my syntax may be completely wrong… :thinking:

And, yes I need to go set up two factor on the gmail account…but, one thing at a time. :roll_eyes:

Hi, any success with binding gmail to the OH? I have done as per examples from mail binding, but got error:
[inding.mail.internal.POP3IMAPHandler] - error when trying to refresh IMAP: Couldn’t connect to host, port: imap.gmail.com, 143; timeout -1

143 doesn’t sound like a valid port for IMAP.