- Platform information:
- Hardware: Raspberry Pi 4
- OS: Raspbian
- openHAB version: 3.0.1
Iโm trying to call the sendHtmlMail method from a smtp-thing, while adding an attachment as ArrayList in JavaScript.
I had done this previously successfully in OH 2.5 using the default rule-languge, so following example works perfectly in OH 2.5:
val List<String> attachmentUrlList = newArrayList("file:///C:/openhab/conf/html/carport/ipcamera.gif")
val mailActions = getActions("mail","mail:smtp:16158a15")
mailActions.sendHtmlMail("my@mail.com", "subject", "body", attachmentUrlList)
Iโm currently in a process of moving to OH 3.0.1 and would prefer using JavaScript for all my scripts/rules, which Iโm way more familiar in, but for some reason I canโt get that array list working and always end up with the a log message explaining me that the fourth parameter does not exist in the method signature:
var mailActions = actions.get("mail","mail:smtp:5041fc7916");
mailActions.sendHtmlMail("my@mail.com", "subject", "body", ["/tmp/test"]);
2021-03-24 10:56:54.006 [ERROR] [internal.handler.ScriptActionHandler] - Script execution of rule with UID 'c2e0c762c4' failed: TypeError: Can not invoke method [jdk.dynalink.beans.SimpleDynamicMethod Boolean org.openhab.binding.mail.internal.action.SendMailActions.sendHtmlMail(String,String,String)] with the passed arguments; they do not match any of its method signatures. in <eval> at line number 11
As soon as I leave out the fourth parameter the mail is successfully send, but I obviously want to have that attachment in the mail as well.