You should use code fences as it can be the spacing that stops YAML from working and no one can see what your using based on your post.
Recommend you check out the Telegram binding. You can send photos, animations like a gif and video mp4 files. Plus you can also send questions with buttons that can turn lights or anything in openHAB on and off remotely. More powerful emails.
The V3 binding just got some updates in the latest snapshot builds and you can see the updated documentation here:
I can’t be sure but that looks a whole lot like the old Mail Action. I don’t think those old 1.x version Actions were ported over to OH 3. Now Actions like that are installed with the bindings instead of separately. So have you installed the Mail binding and configured an SMPT Thing with your SMTP server’s information and credentials? Then you need to pull the Action associated with that Thing to call sendHtmlMail
val mailActions = getActions("mail","mail:smtp:sampleserver")
mailActions.sendHtmlMail("firstname.lastname@example.org", "Test subject", "<h1>Header</h1>This is the mail content.", attachmentUrlList)
OK, so you are using the mail action directly and not from a Script Action. The best I can offer at this point is to file an issue on the binding and see where that goes. I’ve not done that yet so I don’t have any experience to draw from.
2020-11-13 18:11:12.553 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID ‘0ca79312a0’ failed: :1:4 Expected ; but found mailActions
val mailActions = getActions(“mail”,“mail:smtp:Google-SMTP-SRV”)
^ in at line number 1 at column number 4
Thank you very much, the script is now functional better, only e-mails are still not being sent:
There is only a meaningless error message in the log and I am unable to set the mail binding to DEBUG logging:
2020-11-14 10:39:00.328 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID '0ca79312a0' failed: null
I have now switched to “App Password”, but it doesn’t help either.
My rule now looks like this:
At this point all I can offer is to file an issue. There is nothing else obviously wrong. I suggested trying the script action to see if the original problem occurs there’s too, which seems to be the case.
Thanks for pointing this out, I’ll definitely take a look at this. The function with the button in the message has charm. Since I run smart locks on OH, I could just use them to open the door when someone I like rings the bell.
Hello all, I’m really interesting with realizing simple rule only with UI (and thus without my buggy scripts) but I really don’t find how to send mail from the action part of the rule editor.
At the top of this topic (Nov 13, 2020), there is a print screen that show the user can select to send mail in the actions through a thing. I’ve tryed many thing but it’s impossible for me to choose sendMail… I just have following list :