I am no longer able to send email from rules (I used to before I did a reinstall of openHAB about a month ago). The error I get is:
2020-05-20 11:17:56.739 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘notification test’: The name ‘mailActions’ cannot be resolved to an item or type; line 7, column 1, length 11
I have the MailBinding installed, and I set up both a cfg file and a thing.
rule “notification test”
when
Item jack changed
then
val mailActions = getActions(“mail”,“mail:smtp:samplesmtp”)
if (jack.state == ON) {
logInfo(“notifications”, “Sending notification via app.”)
mailActions.sendMail(“myemail@gmail.com”, “Test”,
“This is our notification sent via app.”)
sendNotification(“myemail@gmail.com”,
“This is our notification sent via app.”)
jack.postUpdate(OFF)
}
end
sendNotification works by itself but sendMail doesn’t work.
I’ve read through similar messages on the forum but can’t get this to work.
Thanks, I think I’m almost there! Now I’m getting a STARTTLS command first error. I’m guessing that’s a setting in the things file but I can’t figure it out.