DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING.
THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR.
Enter additional information related to this 'class' inside the {div} macro with 'id=description'
{column:width=80px|padding=0px}{column}{column}{column}
Method Summary
byte[]
getData()
Returns a byte array with the content of this attachment.
getMimeType()
Returns the Mime type of this attachment.
isEmbedded()
Returns true if this attachment is embedded, false otherwise.
{column:width=100%|padding=0px}{column}
Method Details
byte[]
getData
()
Returns
byte[]
Sample
var logo = plugins.mail.createBinaryAttachment('logo.jpg', plugins.file.readFile('d:/logo.jpg')); var invoice = plugins.mail.createTextAttachment('invoice.txt', plugins.file.readTXTFile('d:/invoice.txt')); var attachments = new Array(logo, invoice); var success = plugins.mail.sendMail(toAddress, fromAddress, 'subject line', 'message text', null, null, attachments, properties); if (!success) { plugins.dialogs.showWarningDialog('Alert', 'Failed to send mail', 'OK'); } else { plugins.dialogs.showInfoDialog('Success', 'Mail sent', 'OK'); application.output('logo attachment name: ' + logo.getName()); application.output('logo attachment mime type: ' + logo.getMimeType()); application.output('logo attachment size: ' + logo.getData().length); application.output('logo attachment embedded state: ' + logo.isEmbedded()); application.output('invoice attachment name: ' + invoice.getName()); application.output('invoice attachment mime type: ' + invoice.getMimeType()); application.output('invoice attachment size: ' + invoice.getData().length); application.output('invoice attachment embedded state: ' + invoice.isEmbedded()); }
getMimeType
()
Sample
var logo = plugins.mail.createBinaryAttachment('logo.jpg', plugins.file.readFile('d:/logo.jpg')); var invoice = plugins.mail.createTextAttachment('invoice.txt', plugins.file.readTXTFile('d:/invoice.txt')); var attachments = new Array(logo, invoice); var success = plugins.mail.sendMail(toAddress, fromAddress, 'subject line', 'message text', null, null, attachments, properties); if (!success) { plugins.dialogs.showWarningDialog('Alert', 'Failed to send mail', 'OK'); } else { plugins.dialogs.showInfoDialog('Success', 'Mail sent', 'OK'); application.output('logo attachment name: ' + logo.getName()); application.output('logo attachment mime type: ' + logo.getMimeType()); application.output('logo attachment size: ' + logo.getData().length); application.output('logo attachment embedded state: ' + logo.isEmbedded()); application.output('invoice attachment name: ' + invoice.getName()); application.output('invoice attachment mime type: ' + invoice.getMimeType()); application.output('invoice attachment size: ' + invoice.getData().length); application.output('invoice attachment embedded state: ' + invoice.isEmbedded()); }
getName
()
Sample
var logo = plugins.mail.createBinaryAttachment('logo.jpg', plugins.file.readFile('d:/logo.jpg')); var invoice = plugins.mail.createTextAttachment('invoice.txt', plugins.file.readTXTFile('d:/invoice.txt')); var attachments = new Array(logo, invoice); var success = plugins.mail.sendMail(toAddress, fromAddress, 'subject line', 'message text', null, null, attachments, properties); if (!success) { plugins.dialogs.showWarningDialog('Alert', 'Failed to send mail', 'OK'); } else { plugins.dialogs.showInfoDialog('Success', 'Mail sent', 'OK'); application.output('logo attachment name: ' + logo.getName()); application.output('logo attachment mime type: ' + logo.getMimeType()); application.output('logo attachment size: ' + logo.getData().length); application.output('logo attachment embedded state: ' + logo.isEmbedded()); application.output('invoice attachment name: ' + invoice.getName()); application.output('invoice attachment mime type: ' + invoice.getMimeType()); application.output('invoice attachment size: ' + invoice.getData().length); application.output('invoice attachment embedded state: ' + invoice.isEmbedded()); }
isEmbedded
()
Sample
var logo = plugins.mail.createBinaryAttachment('logo.jpg', plugins.file.readFile('d:/logo.jpg')); var invoice = plugins.mail.createTextAttachment('invoice.txt', plugins.file.readTXTFile('d:/invoice.txt')); var attachments = new Array(logo, invoice); var success = plugins.mail.sendMail(toAddress, fromAddress, 'subject line', 'message text', null, null, attachments, properties); if (!success) { plugins.dialogs.showWarningDialog('Alert', 'Failed to send mail', 'OK'); } else { plugins.dialogs.showInfoDialog('Success', 'Mail sent', 'OK'); application.output('logo attachment name: ' + logo.getName()); application.output('logo attachment mime type: ' + logo.getMimeType()); application.output('logo attachment size: ' + logo.getData().length); application.output('logo attachment embedded state: ' + logo.isEmbedded()); application.output('invoice attachment name: ' + invoice.getName()); application.output('invoice attachment mime type: ' + invoice.getMimeType()); application.output('invoice attachment size: ' + invoice.getData().length); application.output('invoice attachment embedded state: ' + invoice.isEmbedded()); }