I was used old mail action now i used new mail binding after i update openhab 2.5.0
it showed error and not sent it out
log
2019-12-21 16:16:45.554 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Smoke in House': 'sendMail' is not a member of 'org.eclipse.smarthome.core.thing.binding.ThingActions'; line 334, column 2, length 159
rule "example"
when
Item example changed
then
val mailActions = getActions("mail","mail:smtp:sampleserver")
mailActions.sendMail("xxxx@gmail.com","from openhab","Smoke In House "+ Date1.state.format("%1$tB %1$td, %1$tY %1$tI:%1$tM:%1$tS %1$Tp"))
end
2019-12-25 23:47:01.146 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Sicherung_Fussbodenheizung’: ‘sendMail’ is not a member of ‘org.eclipse.smarthome.core.thing.binding.ThingActions’; line 8, column 5, length 90
rule "Sicherung_Fussbodenheizung"
when
Item Sicherung_Fussbodenheizung changed to OFF
then
logError("Sicherung_Fussbodenheizung", "EVENT ist da!!!!!!!!!!!!!!!!!!!!!!!")
val mailActions = getActions("mail","mail:smtp:google")
mailActions.sendMail("myusername@googlemail.com", "Test subject", "This is the mail content.")
end
has thies binding a bug, or is there a config error?
Same problem for me. I’m running the released 2.5. I’ve restarted, and uninstalled and reinstalled the binding. Still has the same problem. I tried stopping and clearing the cache and restarting, and it still has the error. Any further suggestions? I defined the thing in the PaperUI. I did a compare with the name in the json file with my rule and it is identical. The file format is utf-8.
The 1.x Mail Action continues to work fine.
Do I have a typo that I can’t see?
Here’s the error in the log:
'sendMail' is not a member of 'org.eclipse.smarthome.core.thing.binding.ThingActions'
And here’s the rule:
rule "Battery Status Check"
when
Time cron "0 0 17 * * ?"
then
var String msg = ""
var triggerDevices = gBatteryLevel.members.filter[s|(s.state as Number) <= 40]
triggerDevices.forEach [ i |
msg = msg + i.name + ': ' + i.state.toString + '%\n'
]
if (msg != "") {
sendMail("myemail@gmail.com", "Battery Warning", msg) // this one works!
//mail:smtp:db387860
val mailActions = getActions("mail","mail:smtp:db387860")
mailActions.sendMail("myemail@gmail.com","Battery Warning", msg)
}
end
mail versions (is it a problem to have the Mail Action at the same time?):
217 x Active x 80 x 1.14.0 x openHAB Mail Action
246 x Active x 80 x 1.6.2 x JavaMail API
247 x Active x 80 x 2.5.0 x openHAB Add-ons :: Bundles :: Mail Binding
Didn’t work for me. I got thousands and thousands of these errors in the log file once I tried moving that line:
[ERROR] [xbase.resource.BatchLinkableResource] - resolution of uriFragment '|::0.1.0.3::0::/1' failed.
java.lang.NullPointerException: null
Just as a guess I’m trying a things file instead of creating it through PaperUI. I don’t see why that would make any difference, but most users appear to be using the things file.
Depends on how you installed it. If via PaperUI: just click uninstall (probably you have to enable legacy bindings first to see it). If via addons.cfg: delete it from actions=.
I tried all remedies I found here and in other topics, but I keep getting the following error:
‘sendMail’ is not a member of ‘org.eclipse.smarthome.core.thing.binding.ThingActions’
My definitions are as follows.
Presence.rules:
rule "PresenceDetection"
when
Item xyz changed from OFF to ON
then
val mailActions = getActions("mail","mail:smtp:mailserver")
mailActions.sendMail("a@b.c", "Testmail", "Testmail")
end
Restart OH without clearing the cache. That’s what solved the problem with the “sendmail is not a member of error” for me. You must do this every time you clear the cache, or do an upgrade or downgrade of OH (because that process also clears the cache).
I had the same symptom for a different reason. My mail provider requires TLS and I had forgotten to set the SMTP Server Security Protocol to STARTTLS on the SMTP Server Thing.