Child pages
  • Attachment

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Div
styledisplay:none

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.

Div
iddescription



HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Row (tr)
Table Cell (td)
byte[]
Table Cell (td)
getData()
Returns a byte array with the content of this attachment.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
getMimeType()
Returns the Mime type of this attachment.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
getName()
Returns the name of this attachment.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
isEmbedded()
Returns true if this attachment is embedded, false otherwise.



HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Details
Table Body (tbody)
idgetData
Table Row (tr)
idname
Table Cell (td)

getData

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
byte[]
Span
stylefont-weight: bold;
getData
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns a byte array with the content of this attachment.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
byte[]
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
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());
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetMimeType
Table Row (tr)
idname
Table Cell (td)

getMimeType

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getMimeType
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the Mime type of this attachment.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
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());
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetName
Table Row (tr)
idname
Table Cell (td)

getName

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getName
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns the name of this attachment.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
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());
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idisEmbedded
Table Row (tr)
idname
Table Cell (td)

isEmbedded

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
isEmbedded
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns true if this attachment is embedded, false otherwise. Attachments become embedded
if they are references through tags from the body text of the message.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Boolean
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
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());
}
Table Row (tr)
classlastDetailRow
Table Cell (td)