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

Using GMail
To connect to GMail the following settings supplied in the properties Array:

Code Block
var userName = 'xxx';
var passWord = 'yyy';
var properties = new Array();
properties[0] = 'mail.smtp.host=smtp.gmail.com';
properties[1] = 'mail.smtp.auth=true';
properties[2] = 'mail.smtp.username=' + userName;
properties[3] = 'mail.smtp.password=' + passWord;
properties[4] = 'mail.smtp.port=587';
properties[5] = 'mail.smtp.starttls.enable=true';



HTML Table
id
classservoy sReturnTypes
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Return Types
Table Row (tr)
Table Cell (td)
Span
classsWordList
Attachment
Span
classsWordList
MailMessage



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)
Attachment
Table Cell (td)
createBinaryAttachment(filename, binarydata)
Creates a binary attachment object.
Table Row (tr)
Table Cell (td)
Attachment
Table Cell (td)
createBinaryAttachment(filename, binarydata, mimeType)
Creates a binary attachment object.
Table Row (tr)
Table Cell (td)
Attachment
Table Cell (td)
createTextAttachment(filename, textdata)
Creates a text based attachment objec with the default 'text/plain' mimetype
Table Row (tr)
Table Cell (td)
Attachment
Table Cell (td)
createTextAttachment(filename, textdata, mimeType)
Creates a text based attachment object.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
getLastSendMailExceptionMsg()
Get the exception that occurred in the last sendMail attempt (null if no exception occurred).
Table Row (tr)
Table Cell (td)
MailMessage
Table Cell (td)
getMailMessage(binaryblob/string)
Helper method, returns MailMessage object from binary or 7bits string.
Table Row (tr)
Table Cell (td)
String[]
Table Cell (td)
getPlainMailAddresses(addressesString)
Helper method to only get the plain addresses.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
isValidEmailAddress(email)
Checks whether the given e-mail address is valid or not.
Table Row (tr)
Table Cell (td)
MailMessage[]
Table Cell (td)
receiveMail(username, password, leaveMsgsOnServer)
Receive mails from pop3 account.
Table Row (tr)
Table Cell (td)
MailMessage[]
Table Cell (td)
receiveMail(username, password, leaveMsgsOnServer, receiveMode)
Receive mails from pop3 account.
Table Row (tr)
Table Cell (td)
MailMessage[]
Table Cell (td)
receiveMail(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate)
Receive mails from pop3 account.
Table Row (tr)
Table Cell (td)
MailMessage[]
Table Cell (td)
receiveMail(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate, pop3Host)
Receive mails from pop3 account.
Table Row (tr)
Table Cell (td)
MailMessage[]
Table Cell (td)
receiveMail(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate, properties)
Receive mails from pop3 account.
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
sendBulkMail(to, from, subject, msgText)
Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
sendBulkMail(to, from, subject, msgText, cc)
Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
sendBulkMail(to, from, subject, msgText, cc, bcc)
Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
sendBulkMail(to, from, subject, msgText, cc, bcc, attachment)
Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
sendBulkMail(to, from, subject, msgText, cc, bcc, attachment, smtpHost)
Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
sendBulkMail(to, from, subject, msgText, cc, bcc, attachment, overrideProperties)
Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
sendBulkMail(to, from, subject, msgText, cc, bcc, attachments)
Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
sendBulkMail(to, from, subject, msgText, cc, bcc, attachments, smtpHost)
Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
sendBulkMail(to, from, subject, msgText, cc, bcc, attachments, overrideProperties)
Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
sendMail(to, from, subject, msgText)
Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
sendMail(to, from, subject, msgText, cc)
Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
sendMail(to, from, subject, msgText, cc, bcc)
Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
sendMail(to, from, subject, msgText, cc, bcc, attachment)
Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
sendMail(to, from, subject, msgText, cc, bcc, attachment, smtpHost)
Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
sendMail(to, from, subject, msgText, cc, bcc, attachment, overrideProperties)
Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
sendMail(to, from, subject, msgText, cc, bcc, attachments)
Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
sendMail(to, from, subject, msgText, cc, bcc, attachments, smtpHost)
Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
Table Cell (td)
Boolean
Table Cell (td)
sendMail(to, from, subject, msgText, cc, bcc, attachments, overrideProperties)
Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).



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)
idcreateBinaryAttachment-String_byteArray
Table Row (tr)
idname
Table Cell (td)

createBinaryAttachment

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Attachment
Span
stylefont-weight: bold;
createBinaryAttachment
Span
(filename, binarydata)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Creates a binary attachment object.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} filename
{byte[]} binarydata
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
var attachment1 = plugins.mail.createBinaryAttachment('logo1.gif',plugins.file.readFile('c:/temp/a_logo.gif'));
var attachment2 = plugins.mail.createBinaryAttachment('logo2.gif',plugins.file.readFile('c:/temp/another_logo.gif'));
var success = plugins.mail.sendMail('[email protected]', 'John Cobb <[email protected]>', 'subject', 'msgText',null,null,new Array(attachment1,attachment2));
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idcreateBinaryAttachment-String_byteArray_String
Table Row (tr)
idname
Table Cell (td)

createBinaryAttachment

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Attachment
Span
stylefont-weight: bold;
createBinaryAttachment
Span
(filename, binarydata, mimeType)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Creates a binary attachment object.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} filename
{byte[]} binarydata
{String} mimeType
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
var attachment1 = plugins.mail.createBinaryAttachment('logo1.gif',plugins.file.readFile('c:/temp/a_logo.gif', 'image/gif'));
var attachment2 = plugins.mail.createBinaryAttachment('logo2.gif',plugins.file.readFile('c:/temp/another_logo.gif', 'image/gif'));
var success = plugins.mail.sendMail('[email protected]', 'John Cobb <[email protected]>', 'subject', 'msgText',null,null,new Array(attachment1,attachment2));
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idcreateTextAttachment-String_String
Table Row (tr)
idname
Table Cell (td)

createTextAttachment

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Attachment
Span
stylefont-weight: bold;
createTextAttachment
Span
(filename, textdata)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Creates a text based attachment objec with the default 'text/plain' mimetype
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} filename
{String} textdata
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
var attachment = plugins.mail.createTextAttachment('readme.html','<html>bla bla bla');
var success = plugins.mail.sendMail('[email protected]', 'John Cobb <[email protected]>', 'subject', 'msgText',null,null,attachment);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idcreateTextAttachment-String_String_String
Table Row (tr)
idname
Table Cell (td)

createTextAttachment

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Attachment
Span
stylefont-weight: bold;
createTextAttachment
Span
(filename, textdata, mimeType)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Creates a text based attachment object.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} filename
{String} textdata
{String} mimeType
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
var attachment = plugins.mail.createTextAttachment('readme.html','<html>bla bla bla', 'text/html');
var success = plugins.mail.sendMail('[email protected]', 'John Cobb <[email protected]>', 'subject', 'msgText',null,null,attachment);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetLastSendMailExceptionMsg
Table Row (tr)
idname
Table Cell (td)

getLastSendMailExceptionMsg

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getLastSendMailExceptionMsg
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Get the exception that occurred in the last sendMail attempt (null if no exception occurred).
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 success = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', 'my message',null,'[email protected]');
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert',plugins.mail.getLastSendMailExceptionMsg(),'OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetMailMessage-
Table Row (tr)
idname
Table Cell (td)

getMailMessage

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
MailMessage
Span
stylefont-weight: bold;
getMailMessage
Span
(binaryblob/string)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Helper method, returns MailMessage object from binary or 7bits string.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
binaryblob/string
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
var msg = plugins.mail.getMailMessage(myBlob);
if (msg != null) //if is null error occurred!
{
	application.output(msg.getFromAddresses())
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetPlainMailAddresses-
Table Row (tr)
idname
Table Cell (td)

getPlainMailAddresses

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String[]
Span
stylefont-weight: bold;
getPlainMailAddresses
Span
(addressesString)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Helper method to only get the plain addresses.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
addressesString
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 plainArray = plugins.mail.getPlainMailAddresses('John Cobb <[email protected]>,Pete Cobb<[email protected]>');
application.output(plainArray[0]) //will return '[email protected]'
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idisValidEmailAddress-String
Table Row (tr)
idname
Table Cell (td)

isValidEmailAddress

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
isValidEmailAddress
Span
(email)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Checks whether the given e-mail address is valid or not.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} email
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
plugins.mail.isValidEmailAddress("[email protected]");
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idreceiveMail-String_String_Boolean
Table Row (tr)
idname
Table Cell (td)

receiveMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
MailMessage[]
Span
stylefont-weight: bold;
receiveMail
Span
(username, password, leaveMsgsOnServer)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Receive mails from pop3 account.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} username
{String} password
{Boolean} leaveMsgsOnServer
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
var msgs = plugins.mail.receiveMail('mylogin', 'secretpass',  true);
if (msgs != null) //if is null error occurred!
{
	for (var i = 0 ; i < msgs.length ; i++)
	{
		var msg = msgs[i]
		application.output(msg.getFromAddresses())
		application.output(msg.getRecipientAddresses())
		application.output(msg.getReplyAddresses())
		application.output(msg.getSentDate())
		application.output(msg.getHeaders())
		application.output(msg.getSubject())
		application.output(msg.getHtmlMsg())
		application.output(msg.getPlainMsg())
		var attachments = msg.getAttachments()
		if (attachments != null)
		{
			for (var j = 0 ; j < attachments.length ; j++)
			{
				var attachment = attachments[j]
				application.output(attachment.getName())
				var attachmentDataByteArray = attachment.getData()
				//write attachmentDataByteArray to a file...
			}
		}
	}
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idreceiveMail-String_String_Boolean_Number
Table Row (tr)
idname
Table Cell (td)

receiveMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
MailMessage[]
Span
stylefont-weight: bold;
receiveMail
Span
(username, password, leaveMsgsOnServer, receiveMode)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Receive mails from pop3 account.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} username
{String} password
{Boolean} leaveMsgsOnServer
{Number} receiveMode
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
var receiveMode = 1;//0=FULL,1=HEADERS_ONLY,2=NO_ATTACHMENTS
var msgs = plugins.mail.receiveMail('mylogin', 'secretpass',  true,  0);
if (msgs != null) //if is null error occurred!
{
	for (var i = 0 ; i < msgs.length ; i++)
	{
		var msg = msgs[i]
		application.output(msg.getFromAddresses())
		application.output(msg.getRecipientAddresses())
		application.output(msg.getReplyAddresses())
		application.output(msg.getSentDate())
		application.output(msg.getHeaders())
		application.output(msg.getSubject())
	}
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idreceiveMail-String_String_Boolean_Number_Date
Table Row (tr)
idname
Table Cell (td)

receiveMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
MailMessage[]
Span
stylefont-weight: bold;
receiveMail
Span
(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Receive mails from pop3 account.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} username
{String} password
{Boolean} leaveMsgsOnServer
{Number} receiveMode
{Date} onlyReceiveMsgWithSentDate
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
//it is also possible to first receive the headers and later receive a full message with particular 'sentdate'
//var receiveMode = 1;//0=FULL,1=HEADERS_ONLY,2=NO_ATTACHMENTS
var msgs = plugins.mail.receiveMail('mylogin', 'secretpass',  true,  0,  theSentDateObjectFormPreviousHeaderLoading);
if (msgs != null) //if is null error occurred!
{
	for (var i = 0 ; i < msgs.length ; i++)
	{
		var msg = msgs[i]
		application.output(msg.getFromAddresses())
		application.output(msg.getRecipientAddresses())
		application.output(msg.getReplyAddresses())
		application.output(msg.getSentDate())
		application.output(msg.getHeaders())
		application.output(msg.getSubject())
	}
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idreceiveMail-String_String_Boolean_Number_Date_String
Table Row (tr)
idname
Table Cell (td)

receiveMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
MailMessage[]
Span
stylefont-weight: bold;
receiveMail
Span
(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate, pop3Host)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Receive mails from pop3 account.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} username
{String} password
{Boolean} leaveMsgsOnServer
{Number} receiveMode
{Date} onlyReceiveMsgWithSentDate
{String} pop3Host
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
//it is also possible to first receive the headers and later receive a full message
var receiveMode = 0;//0=FULL,1=HEADERS_ONLY,2=NO_ATTACHMENTS
var pop3Host = 'myserver.com';
var msgs = plugins.mail.receiveMail('mylogin', 'secretpass',  true,  receiveMode,  null, pop3Host);
if (msgs != null) //if is null error occurred!
{
	for (var i = 0 ; i < msgs.length ; i++)
	{
		var msg = msgs[i]
		application.output(msg.getFromAddresses())
		application.output(msg.getRecipientAddresses())
		application.output(msg.getReplyAddresses())
		application.output(msg.getSentDate())
		application.output(msg.getHeaders())
		application.output(msg.getSubject())
		application.output(msg.getHtmlMsg())
		application.output(msg.getPlainMsg())
		var attachments = msg.getAttachments()
		if (attachments != null)
		{
			for (var j = 0 ; j < attachments.length ; j++)
			{
				var attachment = attachments[j]
				application.output(attachment.getName())
				var attachmentDataByteArray = attachment.getData()
				//write attachmentDataByteArray to a file...
			}
		}
	}
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idreceiveMail-String_String_Boolean_Number_Date_StringArray
Table Row (tr)
idname
Table Cell (td)

receiveMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
MailMessage[]
Span
stylefont-weight: bold;
receiveMail
Span
(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate, properties)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Receive mails from pop3 account.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} username
{String} password
{Boolean} leaveMsgsOnServer
{Number} receiveMode
{Date} onlyReceiveMsgWithSentDate
{String[]} properties
Table Row (tr)
idret
Table Cell (td)

Returns

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

Sample

Div
classsIndent
Code Block
languagejavascript
var receiveMode = 1;//0=FULL,1=HEADERS_ONLY,2=NO_ATTACHMENTS

var properties = new Array();
properties[0] = 'mail.pop3.port=995';
properties[1] = 'mail.pop3.ssl.enable=true';
properties[2] = 'mail.pop3.host=myserver.com';
properties[3] = '[email protected]';

var msgs = plugins.mail.receiveMail('mylogin', 'secretpass',  true,  receiveMode,  null, properties);
if (msgs != null) //if is null error occurred!
{
	for (var i = 0 ; i < msgs.length ; i++)
	{
		var msg = msgs[i]
		application.output(msg.getFromAddresses())
		application.output(msg.getRecipientAddresses())
		application.output(msg.getReplyAddresses())
		application.output(msg.getSentDate())
		application.output(msg.getHeaders())
		application.output(msg.getSubject())
	}
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendBulkMail-String_String_String_String
Table Row (tr)
idname
Table Cell (td)

sendBulkMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
sendBulkMail
Span
(to, from, subject, msgText)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
A bulk email makes it possible for one to not receive "out of office" emails back from receiver.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} to - A string containing 1 or multiple addresses seperated by a comma.
{String} from - A string containing an address and an optional reply address, seperated by a comma.
{String} subject - The subject of the bulk mail
{String} msgText - The message text
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 msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendBulkMail('[email protected],[email protected]', 'John Cobb <[email protected]>,[email protected]', 'subject', msgText);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendBulkMail-String_String_String_String_String
Table Row (tr)
idname
Table Cell (td)

sendBulkMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
sendBulkMail
Span
(to, from, subject, msgText, cc)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
A bulk email makes it possible for one to not receive "out of office" emails back from receiver.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} to - A string containing 1 or multiple addresses seperated by a comma.
{String} from - A string containing an address and an optional reply address, seperated by a comma.
{String} subject - The subject of the bulk mail
{String} msgText - The message text
{String} cc - One or more addresses seperated by a comma
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 msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendBulkMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,'[email protected],[email protected]');
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendBulkMail-String_String_String_String_String_String
Table Row (tr)
idname
Table Cell (td)

sendBulkMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
sendBulkMail
Span
(to, from, subject, msgText, cc, bcc)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
A bulk email makes it possible for one to not receive "out of office" emails back from receiver.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} to - A string containing 1 or multiple addresses seperated by a comma.
{String} from - A string containing an address and an optional reply address, seperated by a comma.
{String} subject - The subject of the bulk mail
{String} msgText - The message text
{String} cc - One or more addresses seperated by a comma
{String} bcc - One or more addresses seperated by a comma
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 msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendBulkMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]');
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendBulkMail-String_String_String_String_String_String_Attachment
Table Row (tr)
idname
Table Cell (td)

sendBulkMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
sendBulkMail
Span
(to, from, subject, msgText, cc, bcc, attachment)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
A bulk email makes it possible for one to not receive "out of office" emails back from receiver.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} to - A string containing 1 or multiple addresses seperated by a comma.
{String} from - A string containing an address and an optional reply address, seperated by a comma.
{String} subject - The subject of the bulk mail
{String} msgText - The message text
{String} cc - One or more addresses seperated by a comma
{String} bcc - One or more addresses seperated by a comma
{Attachment} attachment - A single attachment
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 attachment = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendBulkMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected],[email protected]',attachment);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendBulkMail-String_String_String_String_String_String_Attachment_String
Table Row (tr)
idname
Table Cell (td)

sendBulkMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
sendBulkMail
Span
(to, from, subject, msgText, cc, bcc, attachment, smtpHost)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
A bulk email makes it possible for one to not receive "out of office" emails back from receiver.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} to - A string containing 1 or multiple addresses seperated by a comma.
{String} from - A string containing an address and an optional reply address, seperated by a comma.
{String} subject - The subject of the bulk mail
{String} msgText - The message text
{String} cc - One or more addresses seperated by a comma
{String} bcc - One or more addresses seperated by a comma
{Attachment} attachment - A single attachment
{String} smtpHost - The smtp host
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 attachment = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var smtphost = 'myserver.com';
var success = plugins.mail.sendBulkMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]',attachment,smtphost);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendBulkMail-String_String_String_String_String_String_Attachment_StringArray
Table Row (tr)
idname
Table Cell (td)

sendBulkMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
sendBulkMail
Span
(to, from, subject, msgText, cc, bcc, attachment, overrideProperties)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
A bulk email makes it possible for one to not receive "out of office" emails back from receiver.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} to - A string containing 1 or multiple addresses seperated by a comma.
{String} from - A string containing an address and an optional reply address, seperated by a comma.
{String} subject - The subject of the bulk mail
{String} msgText - The message text
{String} cc - One or more addresses seperated by a comma
{String} bcc - One or more addresses seperated by a comma
{Attachment} attachment - A single attachment
{String[]} overrideProperties - An array of properties
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 attachment = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
//it is possbile to set all kind of smtp properties
var properties = new Array()
properties[0] = 'mail.smtp.host=myserver.com'
// properties specification can be found at:http://java.sun.com/products/javamail/javadocs/com/sun/mail/smtp/package-summary.html
var success = plugins.mail.sendBulkMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]',attachment,properties);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendBulkMail-String_String_String_String_String_String_AttachmentArray
Table Row (tr)
idname
Table Cell (td)

sendBulkMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
sendBulkMail
Span
(to, from, subject, msgText, cc, bcc, attachments)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
A bulk email makes it possible for one to not receive "out of office" emails back from receiver.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} to - A string containing 1 or multiple addresses seperated by a comma.
{String} from - A string containing an address and an optional reply address, seperated by a comma.
{String} subject - The subject of the bulk mail
{String} msgText - The message text
{String} cc - One or more addresses seperated by a comma
{String} bcc - One or more addresses seperated by a comma
{Attachment[]} attachments - The attachments
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 attachment1 = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var attachment2 = plugins.mail.createTextAttachment('embedded','A text attachement');
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendBulkMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected],[email protected]',[attachment1,attachment2]);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendBulkMail-String_String_String_String_String_String_AttachmentArray_String
Table Row (tr)
idname
Table Cell (td)

sendBulkMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
sendBulkMail
Span
(to, from, subject, msgText, cc, bcc, attachments, smtpHost)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
A bulk email makes it possible for one to not receive "out of office" emails back from receiver.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} to - A string containing 1 or multiple addresses seperated by a comma.
{String} from - A string containing an address and an optional reply address, seperated by a comma.
{String} subject - The subject of the bulk mail
{String} msgText - The message text
{String} cc - One or more addresses seperated by a comma
{String} bcc - One or more addresses seperated by a comma
{Attachment[]} attachments - The attachments
{String} smtpHost - The smtp host
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 attachment1 = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var attachment2 = plugins.mail.createTextAttachment('embedded','A text attachement');
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var smtphost = 'myserver.com';
var success = plugins.mail.sendBulkMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]',[attachment1,attachement2],smtphost);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendBulkMail-String_String_String_String_String_String_AttachmentArray_StringArray
Table Row (tr)
idname
Table Cell (td)

sendBulkMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
sendBulkMail
Span
(to, from, subject, msgText, cc, bcc, attachments, overrideProperties)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
A bulk email makes it possible for one to not receive "out of office" emails back from receiver.
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} to - A string containing 1 or multiple addresses seperated by a comma.
{String} from - A string containing an address and an optional reply address, seperated by a comma.
{String} subject - The subject of the bulk mail
{String} msgText - The message text
{String} cc - One or more addresses seperated by a comma
{String} bcc - One or more addresses seperated by a comma
{Attachment[]} attachments - The attachments
{String[]} overrideProperties - An array of properties
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 attachment1 = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var attachment2 = plugins.mail.createTextAttachment('embedded','A text attachement');
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
//it is possbile to set all kind of smtp properties
var properties = new Array()
properties[0] = 'mail.smtp.host=myserver.com'
// properties specification can be found at:http://java.sun.com/products/javamail/javadocs/com/sun/mail/smtp/package-summary.html
var success = plugins.mail.sendBulkMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]',[attachment1,attachement2],properties);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendMail-String_String_String_String
Table Row (tr)
idname
Table Cell (td)

sendMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
sendMail
Span
(to, from, subject, msgText)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} to - A string containing 1 or multiple addresses seperated by a comma.
{String} from - A string containing an address and an optional reply address, seperated by a comma.
{String} subject - The subject of the mail
{String} msgText - The message text
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 msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>,[email protected]', 'subject', msgText);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendMail-String_String_String_String_String
Table Row (tr)
idname
Table Cell (td)

sendMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
sendMail
Span
(to, from, subject, msgText, cc)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} to - A string containing 1 or multiple addresses seperated by a comma.
{String} from - A string containing an address and an optional reply address, seperated by a comma.
{String} subject - The subject of the mail
{String} msgText - The message text
{String} cc - One or more addresses seperated by a comma
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 msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,'[email protected],[email protected]');
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendMail-String_String_String_String_String_String
Table Row (tr)
idname
Table Cell (td)

sendMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
sendMail
Span
(to, from, subject, msgText, cc, bcc)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} to - A string containing 1 or multiple addresses seperated by a comma.
{String} from - A string containing an address and an optional reply address, seperated by a comma.
{String} subject - The subject of the mail
{String} msgText - The message text
{String} cc - One or more addresses seperated by a comma
{String} bcc - One or more addresses seperated by a comma
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 msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]');
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendMail-String_String_String_String_String_String_Attachment
Table Row (tr)
idname
Table Cell (td)

sendMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
sendMail
Span
(to, from, subject, msgText, cc, bcc, attachment)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} to - A string containing 1 or multiple addresses seperated by a comma.
{String} from - A string containing an address and an optional reply address, seperated by a comma.
{String} subject - The subject of the mail
{String} msgText - The message text
{String} cc - One or more addresses seperated by a comma
{String} bcc - One or more addresses seperated by a comma
{Attachment} attachment - A single attachment
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 attachment = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected],[email protected]',attachment);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendMail-String_String_String_String_String_String_Attachment_String
Table Row (tr)
idname
Table Cell (td)

sendMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
sendMail
Span
(to, from, subject, msgText, cc, bcc, attachment, smtpHost)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} to - A string containing 1 or multiple addresses seperated by a comma.
{String} from - A string containing an address and an optional reply address, seperated by a comma.
{String} subject - The subject of the mail
{String} msgText - The message text
{String} cc - One or more addresses seperated by a comma
{String} bcc - One or more addresses seperated by a comma
{Attachment} attachment - A single attachment
{String} smtpHost - The smtp host
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 attachment = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var smtphost = 'myserver.com';
var success = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]',attachment,smtphost);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendMail-String_String_String_String_String_String_Attachment_StringArray
Table Row (tr)
idname
Table Cell (td)

sendMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
sendMail
Span
(to, from, subject, msgText, cc, bcc, attachment, overrideProperties)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} to - A string containing 1 or multiple addresses seperated by a comma.
{String} from - A string containing an address and an optional reply address, seperated by a comma.
{String} subject - The subject of the mail
{String} msgText - The message text
{String} cc - One or more addresses seperated by a comma
{String} bcc - One or more addresses seperated by a comma
{Attachment} attachment - A single attachment
{String[]} overrideProperties - An array of properties
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 attachment = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
//it is possbile to set all kind of smtp properties
var properties = new Array()
properties[0] = 'mail.smtp.host=myserver.com'
// properties specification can be found at:http://java.sun.com/products/javamail/javadocs/com/sun/mail/smtp/package-summary.html
var success = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]',attachment,properties);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendMail-String_String_String_String_String_String_AttachmentArray
Table Row (tr)
idname
Table Cell (td)

sendMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
sendMail
Span
(to, from, subject, msgText, cc, bcc, attachments)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} to - A string containing 1 or multiple addresses seperated by a comma.
{String} from - A string containing an address and an optional reply address, seperated by a comma.
{String} subject - The subject of the mail
{String} msgText - The message text
{String} cc - One or more addresses seperated by a comma
{String} bcc - One or more addresses seperated by a comma
{Attachment[]} attachments - The attachments
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 attachment1 = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var attachment2 = plugins.mail.createTextAttachment('embedded','A text attachement');
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var success = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected],[email protected]',[attachment1,attachment2]);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendMail-String_String_String_String_String_String_AttachmentArray_String
Table Row (tr)
idname
Table Cell (td)

sendMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
sendMail
Span
(to, from, subject, msgText, cc, bcc, attachments, smtpHost)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} to - A string containing 1 or multiple addresses seperated by a comma.
{String} from - A string containing an address and an optional reply address, seperated by a comma.
{String} subject - The subject of the mail
{String} msgText - The message text
{String} cc - One or more addresses seperated by a comma
{String} bcc - One or more addresses seperated by a comma
{Attachment[]} attachments - The attachments
{String} smtpHost - The smtp host
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 attachment1 = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var attachment2 = plugins.mail.createTextAttachment('embedded','A text attachement');
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
var smtphost = 'myserver.com';
var success = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]',[attachment1,attachement2],smtphost);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idsendMail-String_String_String_String_String_String_AttachmentArray_StringArray
Table Row (tr)
idname
Table Cell (td)

sendMail

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Boolean
Span
stylefont-weight: bold;
sendMail
Span
(to, from, subject, msgText, cc, bcc, attachments, overrideProperties)
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).
Table Row (tr)
idprs
Table Cell (td)

Parameters

Div
classsIndent
{String} to - A string containing 1 or multiple addresses seperated by a comma.
{String} from - A string containing an address and an optional reply address, seperated by a comma.
{String} subject - The subject of the mail
{String} msgText - The message text
{String} cc - One or more addresses seperated by a comma
{String} bcc - One or more addresses seperated by a comma
{Attachment[]} attachments - The attachments
{String[]} overrideProperties - An array of properties
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 attachment1 = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif'));
var attachment2 = plugins.mail.createTextAttachment('embedded','A text attachement');
var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>';
//it is possbile to set all kind of smtp properties
var properties = new Array()
properties[0] = 'mail.smtp.host=myserver.com'
// properties specification can be found at:http://java.sun.com/products/javamail/javadocs/com/sun/mail/smtp/package-summary.html
var success = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]',[attachment1,attachement2],properties);
if (!success)
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}
Table Row (tr)
classlastDetailRow
Table Cell (td)