When my method attempts to create a binary attachment for an email sent via the mail plugin, I get an error of java.lang.ClassCastException. Here is the code:
var binaryFile = application.readFile( pdfPath );
var pdfAttachment = plugins.mail.createBinaryAttachment("TEST.PDF", binaryFile );
I have also tried plugins.file.readFile() in place of application.readFile() and get the same error. If I leave out the variable ‘pdfPath’, I get a select file dialog that allows me to choose the file manually, but I still get an error.
This appears to be related to 2.2.2. I tried this method on my client’s install of 2.2.1 and I do not get this error. I am unable, however to reinstall 2.2.1 on my own machine. Old installer files used to allow me to upgrade incrementally, but now, my 2.2 installer will only upgrade directly to 2.2.2.
Edit 11/21 10:10 am: I found a local machine with 2.2.1 installed and this error DOES NOT occur.
Steve In LA