{hidden}
DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING.
		THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden}
{sub-section:description|text=}{sub-section}\\{table:class=servoy sReturnTypes}{tr:style=height: 30px;}{th}Return Types{th}{tr}{tr}{td}{span:class=sWordList}[Attachment]{span}{span:class=sWordList}[MailMessage]{span}{td}{tr}{table}\\{table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[Attachment]{td}{td}[#createBinaryAttachment]\(filename, binarydata, mimeType)
Creates a binary attachment object.{td}{tr}{tbody}{tbody}{tr}{td}[Attachment]{td}{td}[#createTextAttachment]\(filename, textdata, mimeType)
Creates a text based attachment object.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getLastSendMailExceptionMsg]\()
Get the exception that occurred in the last sendMail attempt (null if no exception occurred).{td}{tr}{tbody}{tbody}{tr}{td}[MailMessage]{td}{td}[#getMailMessage]\(binaryblob/string)
Helper method, returns MailMessage object from binary or 7bits string.{td}{tr}{tbody}{tbody}{tr}{td}[String]\[]{td}{td}[#getPlainMailAddresses]\(addressesString)
Helper method to only get the plain addresses.{td}{tr}{tbody}{tbody}{tr}{td}[MailMessage]\[]{td}{td}[#receiveMail]\(userName, password, leaveMsgsOnServer, receiveMode, onlyreceiveMsgWithSentDate, overridePreferencePOP3Host/properties array)
Receive mails from pop3 account.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#sendMail]\(to, from, subject, msgText, cc, bcc, attachment/attachments array, overridePreferenceSMTPHost/properties array)
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).{td}{tr}{tbody}{table}\\{table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=FE0676F0-5000-49C5-BC8E-3B972DB7D9EC}{tr:id=name}{td}h6.createBinaryAttachment{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Attachment]{span}{span:id=iets|style=float: left; font-weight: bold;}createBinaryAttachment{span}{span:id=iets|style=float: left;}\(filename, binarydata, mimeType){span}{td}{tr}{tr:id=des}{td}{sub-section:FE0676F0-5000-49C5-BC8E-3B972DB7D9EC_des|text=|trigger=button}{sub-section}{sub-section:FE0676F0-5000-49C5-BC8E-3B972DB7D9EC_des|trigger=none|class=sIndent}Creates a binary attachment object.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:FE0676F0-5000-49C5-BC8E-3B972DB7D9EC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:FE0676F0-5000-49C5-BC8E-3B972DB7D9EC_prs|trigger=none}filename
binarydata
\[mimeType\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:FE0676F0-5000-49C5-BC8E-3B972DB7D9EC_ret|text=|trigger=button}{sub-section}{sub-section:FE0676F0-5000-49C5-BC8E-3B972DB7D9EC_ret|trigger=none|class=sIndent}[Attachment]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:FE0676F0-5000-49C5-BC8E-3B972DB7D9EC_see|text=|trigger=button}{sub-section}{sub-section:FE0676F0-5000-49C5-BC8E-3B972DB7D9EC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:FE0676F0-5000-49C5-BC8E-3B972DB7D9EC_see|text=|trigger=button}{sub-section}{sub-section:FE0676F0-5000-49C5-BC8E-3B972DB7D9EC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:FE0676F0-5000-49C5-BC8E-3B972DB7D9EC_sam|text=|trigger=button}{sub-section}{sub-section:FE0676F0-5000-49C5-BC8E-3B972DB7D9EC_sam|class=sIndent|trigger=none}{code:language=javascript}
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');
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=8A840438-ADE5-4A6E-975E-4DF871FD451A}{tr:id=name}{td}h6.createTextAttachment{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Attachment]{span}{span:id=iets|style=float: left; font-weight: bold;}createTextAttachment{span}{span:id=iets|style=float: left;}\(filename, textdata, mimeType){span}{td}{tr}{tr:id=des}{td}{sub-section:8A840438-ADE5-4A6E-975E-4DF871FD451A_des|text=|trigger=button}{sub-section}{sub-section:8A840438-ADE5-4A6E-975E-4DF871FD451A_des|trigger=none|class=sIndent}Creates a text based attachment object.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:8A840438-ADE5-4A6E-975E-4DF871FD451A_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:8A840438-ADE5-4A6E-975E-4DF871FD451A_prs|trigger=none}filename
textdata
\[mimeType\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:8A840438-ADE5-4A6E-975E-4DF871FD451A_ret|text=|trigger=button}{sub-section}{sub-section:8A840438-ADE5-4A6E-975E-4DF871FD451A_ret|trigger=none|class=sIndent}[Attachment]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:8A840438-ADE5-4A6E-975E-4DF871FD451A_see|text=|trigger=button}{sub-section}{sub-section:8A840438-ADE5-4A6E-975E-4DF871FD451A_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:8A840438-ADE5-4A6E-975E-4DF871FD451A_see|text=|trigger=button}{sub-section}{sub-section:8A840438-ADE5-4A6E-975E-4DF871FD451A_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:8A840438-ADE5-4A6E-975E-4DF871FD451A_sam|text=|trigger=button}{sub-section}{sub-section:8A840438-ADE5-4A6E-975E-4DF871FD451A_sam|class=sIndent|trigger=none}{code:language=javascript}
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');
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=A740AD94-E595-4100-9E3F-5E4B7217D9D8}{tr:id=name}{td}h6.getLastSendMailExceptionMsg{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getLastSendMailExceptionMsg{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:A740AD94-E595-4100-9E3F-5E4B7217D9D8_des|text=|trigger=button}{sub-section}{sub-section:A740AD94-E595-4100-9E3F-5E4B7217D9D8_des|trigger=none|class=sIndent}Get the exception that occurred in the last sendMail attempt (null if no exception occurred).{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:A740AD94-E595-4100-9E3F-5E4B7217D9D8_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:A740AD94-E595-4100-9E3F-5E4B7217D9D8_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:A740AD94-E595-4100-9E3F-5E4B7217D9D8_ret|text=|trigger=button}{sub-section}{sub-section:A740AD94-E595-4100-9E3F-5E4B7217D9D8_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:A740AD94-E595-4100-9E3F-5E4B7217D9D8_see|text=|trigger=button}{sub-section}{sub-section:A740AD94-E595-4100-9E3F-5E4B7217D9D8_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:A740AD94-E595-4100-9E3F-5E4B7217D9D8_see|text=|trigger=button}{sub-section}{sub-section:A740AD94-E595-4100-9E3F-5E4B7217D9D8_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:A740AD94-E595-4100-9E3F-5E4B7217D9D8_sam|text=|trigger=button}{sub-section}{sub-section:A740AD94-E595-4100-9E3F-5E4B7217D9D8_sam|class=sIndent|trigger=none}{code:language=javascript}
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');
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=63EBB073-5780-4E4B-9D57-A14F52F30CD2}{tr:id=name}{td}h6.getMailMessage{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[MailMessage]{span}{span:id=iets|style=float: left; font-weight: bold;}getMailMessage{span}{span:id=iets|style=float: left;}\(binaryblob/string){span}{td}{tr}{tr:id=des}{td}{sub-section:63EBB073-5780-4E4B-9D57-A14F52F30CD2_des|text=|trigger=button}{sub-section}{sub-section:63EBB073-5780-4E4B-9D57-A14F52F30CD2_des|trigger=none|class=sIndent}Helper method, returns MailMessage object from binary or 7bits string.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:63EBB073-5780-4E4B-9D57-A14F52F30CD2_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:63EBB073-5780-4E4B-9D57-A14F52F30CD2_prs|trigger=none}binaryblob/string
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:63EBB073-5780-4E4B-9D57-A14F52F30CD2_ret|text=|trigger=button}{sub-section}{sub-section:63EBB073-5780-4E4B-9D57-A14F52F30CD2_ret|trigger=none|class=sIndent}[MailMessage]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:63EBB073-5780-4E4B-9D57-A14F52F30CD2_see|text=|trigger=button}{sub-section}{sub-section:63EBB073-5780-4E4B-9D57-A14F52F30CD2_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:63EBB073-5780-4E4B-9D57-A14F52F30CD2_see|text=|trigger=button}{sub-section}{sub-section:63EBB073-5780-4E4B-9D57-A14F52F30CD2_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:63EBB073-5780-4E4B-9D57-A14F52F30CD2_sam|text=|trigger=button}{sub-section}{sub-section:63EBB073-5780-4E4B-9D57-A14F52F30CD2_sam|class=sIndent|trigger=none}{code:language=javascript}
var msg = plugins.mail.getMailMessage(myColumn);
if (msg != null) //if is null error occurred!
{
	application.output(msg.getFromAddresses())
}
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=708EE3A6-5FA1-4101-8484-CA246ABC3B5E}{tr:id=name}{td}h6.getPlainMailAddresses{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getPlainMailAddresses{span}{span:id=iets|style=float: left;}\(addressesString){span}{td}{tr}{tr:id=des}{td}{sub-section:708EE3A6-5FA1-4101-8484-CA246ABC3B5E_des|text=|trigger=button}{sub-section}{sub-section:708EE3A6-5FA1-4101-8484-CA246ABC3B5E_des|trigger=none|class=sIndent}Helper method to only get the plain addresses.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:708EE3A6-5FA1-4101-8484-CA246ABC3B5E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:708EE3A6-5FA1-4101-8484-CA246ABC3B5E_prs|trigger=none}addressesString
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:708EE3A6-5FA1-4101-8484-CA246ABC3B5E_ret|text=|trigger=button}{sub-section}{sub-section:708EE3A6-5FA1-4101-8484-CA246ABC3B5E_ret|trigger=none|class=sIndent}[String]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:708EE3A6-5FA1-4101-8484-CA246ABC3B5E_see|text=|trigger=button}{sub-section}{sub-section:708EE3A6-5FA1-4101-8484-CA246ABC3B5E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:708EE3A6-5FA1-4101-8484-CA246ABC3B5E_see|text=|trigger=button}{sub-section}{sub-section:708EE3A6-5FA1-4101-8484-CA246ABC3B5E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:708EE3A6-5FA1-4101-8484-CA246ABC3B5E_sam|text=|trigger=button}{sub-section}{sub-section:708EE3A6-5FA1-4101-8484-CA246ABC3B5E_sam|class=sIndent|trigger=none}{code:language=javascript}
var plainArray = plugins.mail.getPlainMailAddresses('John Cobb <[email protected]>;Pete Cobb<[email protected]>');
application.output(plainArray[0]) //will return '[email protected]'
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=A9DE4EE1-40BE-425A-8138-6204244E0EFB}{tr:id=name}{td}h6.receiveMail{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[MailMessage]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}receiveMail{span}{span:id=iets|style=float: left;}\(userName, password, leaveMsgsOnServer, receiveMode, onlyreceiveMsgWithSentDate, overridePreferencePOP3Host/properties array){span}{td}{tr}{tr:id=des}{td}{sub-section:A9DE4EE1-40BE-425A-8138-6204244E0EFB_des|text=|trigger=button}{sub-section}{sub-section:A9DE4EE1-40BE-425A-8138-6204244E0EFB_des|trigger=none|class=sIndent}Receive mails from pop3 account.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:A9DE4EE1-40BE-425A-8138-6204244E0EFB_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:A9DE4EE1-40BE-425A-8138-6204244E0EFB_prs|trigger=none}userName
password
leaveMsgsOnServer
\[receiveMode\]
\[onlyreceiveMsgWithSentDate\]
\[overridePreferencePOP3Host/properties array\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:A9DE4EE1-40BE-425A-8138-6204244E0EFB_ret|text=|trigger=button}{sub-section}{sub-section:A9DE4EE1-40BE-425A-8138-6204244E0EFB_ret|trigger=none|class=sIndent}[MailMessage]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:A9DE4EE1-40BE-425A-8138-6204244E0EFB_see|text=|trigger=button}{sub-section}{sub-section:A9DE4EE1-40BE-425A-8138-6204244E0EFB_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:A9DE4EE1-40BE-425A-8138-6204244E0EFB_see|text=|trigger=button}{sub-section}{sub-section:A9DE4EE1-40BE-425A-8138-6204244E0EFB_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:A9DE4EE1-40BE-425A-8138-6204244E0EFB_sam|text=|trigger=button}{sub-section}{sub-section:A9DE4EE1-40BE-425A-8138-6204244E0EFB_sam|class=sIndent|trigger=none}{code:language=javascript}
var msgs = plugins.mail.receiveMail('me', 'test', 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.getReceivedDate())
		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...
			}
		}
	}
}

//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('me', 'test', true ,receiveMode);

//when first did receive the headers(=all_field+subject,no body and no attachemnt), get a msg with a specific sentdate
//var msgs = plugins.mail.receiveMail('me', 'test', true , 1 , theSentDateObjectFormPreviousHeaderLoading);

//it is possbile to set all kind of pop3 properties
//var properties = new Array()
//properties[0] = 'mail.pop3.host=myserver.com'
//properties specification can be found at:http://java.sun.com/products/javamail/javadocs/com/sun/mail/pop3/package-summary.html
//var msgs = plugins.mail.receiveMail('me', 'test', true , 0 , null, properties);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=FDF7F45A-5690-4AAD-B0A1-E1B6CC4A96C7}{tr:id=name}{td}h6.sendMail{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}sendMail{span}{span:id=iets|style=float: left;}\(to, from, subject, msgText, cc, bcc, attachment/attachments array, overridePreferenceSMTPHost/properties array){span}{td}{tr}{tr:id=des}{td}{sub-section:FDF7F45A-5690-4AAD-B0A1-E1B6CC4A96C7_des|text=|trigger=button}{sub-section}{sub-section:FDF7F45A-5690-4AAD-B0A1-E1B6CC4A96C7_des|trigger=none|class=sIndent}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).{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:FDF7F45A-5690-4AAD-B0A1-E1B6CC4A96C7_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:FDF7F45A-5690-4AAD-B0A1-E1B6CC4A96C7_prs|trigger=none}to
from
subject
msgText
\[cc\]
\[bcc\]
\[attachment/attachments array\]
\[overridePreferenceSMTPHost/properties array\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:FDF7F45A-5690-4AAD-B0A1-E1B6CC4A96C7_ret|text=|trigger=button}{sub-section}{sub-section:FDF7F45A-5690-4AAD-B0A1-E1B6CC4A96C7_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:FDF7F45A-5690-4AAD-B0A1-E1B6CC4A96C7_see|text=|trigger=button}{sub-section}{sub-section:FDF7F45A-5690-4AAD-B0A1-E1B6CC4A96C7_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:FDF7F45A-5690-4AAD-B0A1-E1B6CC4A96C7_see|text=|trigger=button}{sub-section}{sub-section:FDF7F45A-5690-4AAD-B0A1-E1B6CC4A96C7_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:FDF7F45A-5690-4AAD-B0A1-E1B6CC4A96C7_sam|text=|trigger=button}{sub-section}{sub-section:FDF7F45A-5690-4AAD-B0A1-E1B6CC4A96C7_sam|class=sIndent|trigger=none}{code:language=javascript}
var attachment1 = 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]',[attachment1]);
if (!success) 
{
	plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}

//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 msgs = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]',null, properties);
{code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}