VMware Aria Automation offers a mime attachment class, to describe mime attachments in the context of the JavaScript runtime environment. The Multipurpose Internet Mail Extensions (MIME) is a standard that extends the format of messages to support text in character sets other than ASCII. To use the methods of the this class outside of Aria Automation, a library is available here to emulate it.
This mock-up of the mime attachment class bases on the same JavaScript engine used in Aria Automation, the
Mozilla Rhino engine. To use this file classes it is necessary to use the Rhino engine, because their constructor and method access Java classes directly. This ensures us a consistent basis for simulation and operation.
To use this library in your code it is necessary to add e.g.
load("mimeattachment.class.js");
at the beginning of the program. After that, all functions can be used seamlessly just like in Aria Automation.
You can download the source from
my GitHub account.