{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=}*Using GMail*
To connect to GMail the following settings supplied in the properties Array:
{code}
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';
{code}{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}Server Property Summary{th}{tr}{tbody}{tr}{td}{td}{td}[#mail.development.override.address]
{td}{tr}{tbody}{tbody}{tr}{td}{td}{td}[#mail.mime.charset]
{td}{tr}{tbody}{tbody}{tr}{td}{td}{td}[#mail.pop3.apop.enable]
{td}{tr}{tbody}{tbody}{tr}{td}{td}{td}[#mail.pop3.host]
{td}{tr}{tbody}{tbody}{tr}{td}{td}{td}[#mail.smtp.auth]
{td}{tr}{tbody}{tbody}{tr}{td}{td}{td}[#mail.smtp.connectiontimeout]
{td}{tr}{tbody}{tbody}{tr}{td}{td}{td}[#mail.smtp.host]
{td}{tr}{tbody}{tbody}{tr}{td}{td}{td}[#mail.smtp.password]
{td}{tr}{tbody}{tbody}{tr}{td}{td}{td}[#mail.smtp.socketFactory.class]
{td}{tr}{tbody}{tbody}{tr}{td}{td}{td}[#mail.smtp.socketFactory.fallback]
{td}{tr}{tbody}{tbody}{tr}{td}{td}{td}[#mail.smtp.socketFactory.port]
{td}{tr}{tbody}{tbody}{tr}{td}{td}{td}[#mail.smtp.timeout]
{td}{tr}{tbody}{tbody}{tr}{td}{td}{td}[#mail.smtp.username]
{td}{tr}{tbody}{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}Server Property Details{th}{tr}{tbody:id=77F3A3F1-E706-472D-91DC-50BAB68F2277}{tr:id=name}{td}h6.mail.development.override.address{td}{tr}{tr:id=des}{td}{sub-section:77F3A3F1-E706-472D-91DC-50BAB68F2277_des|text=|trigger=button}{sub-section}{sub-section:77F3A3F1-E706-472D-91DC-50BAB68F2277_des|trigger=none|class=sIndent}Specify an email address to which all email will be send instead of the specified To, Cc and Bcc addresses.
The specified to, Cc and Bcc addresses will be added to the Subject.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:77F3A3F1-E706-472D-91DC-50BAB68F2277_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:77F3A3F1-E706-472D-91DC-50BAB68F2277_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:77F3A3F1-E706-472D-91DC-50BAB68F2277_ret|text=|trigger=button}{sub-section}{sub-section:77F3A3F1-E706-472D-91DC-50BAB68F2277_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:77F3A3F1-E706-472D-91DC-50BAB68F2277_see|text=|trigger=button}{sub-section}{sub-section:77F3A3F1-E706-472D-91DC-50BAB68F2277_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:77F3A3F1-E706-472D-91DC-50BAB68F2277_see|text=|trigger=button}{sub-section}{sub-section:77F3A3F1-E706-472D-91DC-50BAB68F2277_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:77F3A3F1-E706-472D-91DC-50BAB68F2277_sam|text=|trigger=button}{sub-section}{sub-section:77F3A3F1-E706-472D-91DC-50BAB68F2277_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=678CF301-8485-4141-86F4-9CF136E4ACB2}{tr:id=name}{td}h6.mail.mime.charset{td}{tr}{tr:id=des}{td}{sub-section:678CF301-8485-4141-86F4-9CF136E4ACB2_des|text=|trigger=button}{sub-section}{sub-section:678CF301-8485-4141-86F4-9CF136E4ACB2_des|trigger=none|class=sIndent}Specify the name of the charset to use for mail encoding (leave emtpy for system default), see http://java.sun.com/j2se/1.4.2/docs/api/java/nio/charset/Charset.html forinfo which charset names are usable{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:678CF301-8485-4141-86F4-9CF136E4ACB2_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:678CF301-8485-4141-86F4-9CF136E4ACB2_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:678CF301-8485-4141-86F4-9CF136E4ACB2_ret|text=|trigger=button}{sub-section}{sub-section:678CF301-8485-4141-86F4-9CF136E4ACB2_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:678CF301-8485-4141-86F4-9CF136E4ACB2_see|text=|trigger=button}{sub-section}{sub-section:678CF301-8485-4141-86F4-9CF136E4ACB2_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:678CF301-8485-4141-86F4-9CF136E4ACB2_see|text=|trigger=button}{sub-section}{sub-section:678CF301-8485-4141-86F4-9CF136E4ACB2_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:678CF301-8485-4141-86F4-9CF136E4ACB2_sam|text=|trigger=button}{sub-section}{sub-section:678CF301-8485-4141-86F4-9CF136E4ACB2_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=B53B077B-ECCF-4932-9566-E521437CDB6E}{tr:id=name}{td}h6.mail.pop3.apop.enable{td}{tr}{tr:id=des}{td}{sub-section:B53B077B-ECCF-4932-9566-E521437CDB6E_des|text=|trigger=button}{sub-section}{sub-section:B53B077B-ECCF-4932-9566-E521437CDB6E_des|trigger=none|class=sIndent}Whether or not to use APOP for authentication (true/false){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:B53B077B-ECCF-4932-9566-E521437CDB6E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B53B077B-ECCF-4932-9566-E521437CDB6E_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:B53B077B-ECCF-4932-9566-E521437CDB6E_ret|text=|trigger=button}{sub-section}{sub-section:B53B077B-ECCF-4932-9566-E521437CDB6E_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B53B077B-ECCF-4932-9566-E521437CDB6E_see|text=|trigger=button}{sub-section}{sub-section:B53B077B-ECCF-4932-9566-E521437CDB6E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B53B077B-ECCF-4932-9566-E521437CDB6E_see|text=|trigger=button}{sub-section}{sub-section:B53B077B-ECCF-4932-9566-E521437CDB6E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:B53B077B-ECCF-4932-9566-E521437CDB6E_sam|text=|trigger=button}{sub-section}{sub-section:B53B077B-ECCF-4932-9566-E521437CDB6E_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=F726188E-A654-4DB3-BDD4-A7214D74BE7E}{tr:id=name}{td}h6.mail.pop3.host{td}{tr}{tr:id=des}{td}{sub-section:F726188E-A654-4DB3-BDD4-A7214D74BE7E_des|text=|trigger=button}{sub-section}{sub-section:F726188E-A654-4DB3-BDD4-A7214D74BE7E_des|trigger=none|class=sIndent}The name of POP3 server to recieve mails from{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:F726188E-A654-4DB3-BDD4-A7214D74BE7E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:F726188E-A654-4DB3-BDD4-A7214D74BE7E_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:F726188E-A654-4DB3-BDD4-A7214D74BE7E_ret|text=|trigger=button}{sub-section}{sub-section:F726188E-A654-4DB3-BDD4-A7214D74BE7E_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:F726188E-A654-4DB3-BDD4-A7214D74BE7E_see|text=|trigger=button}{sub-section}{sub-section:F726188E-A654-4DB3-BDD4-A7214D74BE7E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:F726188E-A654-4DB3-BDD4-A7214D74BE7E_see|text=|trigger=button}{sub-section}{sub-section:F726188E-A654-4DB3-BDD4-A7214D74BE7E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:F726188E-A654-4DB3-BDD4-A7214D74BE7E_sam|text=|trigger=button}{sub-section}{sub-section:F726188E-A654-4DB3-BDD4-A7214D74BE7E_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=D04EA3E5-F3CA-4AE7-9B79-41CB914FE292}{tr:id=name}{td}h6.mail.smtp.auth{td}{tr}{tr:id=des}{td}{sub-section:D04EA3E5-F3CA-4AE7-9B79-41CB914FE292_des|text=|trigger=button}{sub-section}{sub-section:D04EA3E5-F3CA-4AE7-9B79-41CB914FE292_des|trigger=none|class=sIndent}Use authentication (true/false){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:D04EA3E5-F3CA-4AE7-9B79-41CB914FE292_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:D04EA3E5-F3CA-4AE7-9B79-41CB914FE292_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:D04EA3E5-F3CA-4AE7-9B79-41CB914FE292_ret|text=|trigger=button}{sub-section}{sub-section:D04EA3E5-F3CA-4AE7-9B79-41CB914FE292_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:D04EA3E5-F3CA-4AE7-9B79-41CB914FE292_see|text=|trigger=button}{sub-section}{sub-section:D04EA3E5-F3CA-4AE7-9B79-41CB914FE292_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:D04EA3E5-F3CA-4AE7-9B79-41CB914FE292_see|text=|trigger=button}{sub-section}{sub-section:D04EA3E5-F3CA-4AE7-9B79-41CB914FE292_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:D04EA3E5-F3CA-4AE7-9B79-41CB914FE292_sam|text=|trigger=button}{sub-section}{sub-section:D04EA3E5-F3CA-4AE7-9B79-41CB914FE292_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=493EBA5A-8115-49A8-8A04-C4307DD6AA0E}{tr:id=name}{td}h6.mail.smtp.connectiontimeout{td}{tr}{tr:id=des}{td}{sub-section:493EBA5A-8115-49A8-8A04-C4307DD6AA0E_des|text=|trigger=button}{sub-section}{sub-section:493EBA5A-8115-49A8-8A04-C4307DD6AA0E_des|trigger=none|class=sIndent}Socket connection timeout value in milliseconds. Default is infinite timeout.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:493EBA5A-8115-49A8-8A04-C4307DD6AA0E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:493EBA5A-8115-49A8-8A04-C4307DD6AA0E_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:493EBA5A-8115-49A8-8A04-C4307DD6AA0E_ret|text=|trigger=button}{sub-section}{sub-section:493EBA5A-8115-49A8-8A04-C4307DD6AA0E_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:493EBA5A-8115-49A8-8A04-C4307DD6AA0E_see|text=|trigger=button}{sub-section}{sub-section:493EBA5A-8115-49A8-8A04-C4307DD6AA0E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:493EBA5A-8115-49A8-8A04-C4307DD6AA0E_see|text=|trigger=button}{sub-section}{sub-section:493EBA5A-8115-49A8-8A04-C4307DD6AA0E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:493EBA5A-8115-49A8-8A04-C4307DD6AA0E_sam|text=|trigger=button}{sub-section}{sub-section:493EBA5A-8115-49A8-8A04-C4307DD6AA0E_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=1A5EBC20-7680-450F-89FF-53E5C3586A71}{tr:id=name}{td}h6.mail.smtp.host{td}{tr}{tr:id=des}{td}{sub-section:1A5EBC20-7680-450F-89FF-53E5C3586A71_des|text=|trigger=button}{sub-section}{sub-section:1A5EBC20-7680-450F-89FF-53E5C3586A71_des|trigger=none|class=sIndent}The name of SMTP server to deliver the mails to{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:1A5EBC20-7680-450F-89FF-53E5C3586A71_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:1A5EBC20-7680-450F-89FF-53E5C3586A71_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:1A5EBC20-7680-450F-89FF-53E5C3586A71_ret|text=|trigger=button}{sub-section}{sub-section:1A5EBC20-7680-450F-89FF-53E5C3586A71_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:1A5EBC20-7680-450F-89FF-53E5C3586A71_see|text=|trigger=button}{sub-section}{sub-section:1A5EBC20-7680-450F-89FF-53E5C3586A71_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:1A5EBC20-7680-450F-89FF-53E5C3586A71_see|text=|trigger=button}{sub-section}{sub-section:1A5EBC20-7680-450F-89FF-53E5C3586A71_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:1A5EBC20-7680-450F-89FF-53E5C3586A71_sam|text=|trigger=button}{sub-section}{sub-section:1A5EBC20-7680-450F-89FF-53E5C3586A71_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=63988A23-33D5-4889-BFE5-92653B3B102B}{tr:id=name}{td}h6.mail.smtp.password{td}{tr}{tr:id=des}{td}{sub-section:63988A23-33D5-4889-BFE5-92653B3B102B_des|text=|trigger=button}{sub-section}{sub-section:63988A23-33D5-4889-BFE5-92653B3B102B_des|trigger=none|class=sIndent}Specify password if using authentication{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:63988A23-33D5-4889-BFE5-92653B3B102B_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:63988A23-33D5-4889-BFE5-92653B3B102B_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:63988A23-33D5-4889-BFE5-92653B3B102B_ret|text=|trigger=button}{sub-section}{sub-section:63988A23-33D5-4889-BFE5-92653B3B102B_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:63988A23-33D5-4889-BFE5-92653B3B102B_see|text=|trigger=button}{sub-section}{sub-section:63988A23-33D5-4889-BFE5-92653B3B102B_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:63988A23-33D5-4889-BFE5-92653B3B102B_see|text=|trigger=button}{sub-section}{sub-section:63988A23-33D5-4889-BFE5-92653B3B102B_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:63988A23-33D5-4889-BFE5-92653B3B102B_sam|text=|trigger=button}{sub-section}{sub-section:63988A23-33D5-4889-BFE5-92653B3B102B_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=0B06E7FB-3017-4DFD-AC34-CD79475EAD9C}{tr:id=name}{td}h6.mail.smtp.socketFactory.class{td}{tr}{tr:id=des}{td}{sub-section:0B06E7FB-3017-4DFD-AC34-CD79475EAD9C_des|text=|trigger=button}{sub-section}{sub-section:0B06E7FB-3017-4DFD-AC34-CD79475EAD9C_des|trigger=none|class=sIndent}If set, specifies the name of a class that implements the javax.net.SocketFactory interface. This class will be used to create SMTP sockets. Use "javax.net.ssl.SSLSocketFactory" for SSL{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:0B06E7FB-3017-4DFD-AC34-CD79475EAD9C_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:0B06E7FB-3017-4DFD-AC34-CD79475EAD9C_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:0B06E7FB-3017-4DFD-AC34-CD79475EAD9C_ret|text=|trigger=button}{sub-section}{sub-section:0B06E7FB-3017-4DFD-AC34-CD79475EAD9C_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:0B06E7FB-3017-4DFD-AC34-CD79475EAD9C_see|text=|trigger=button}{sub-section}{sub-section:0B06E7FB-3017-4DFD-AC34-CD79475EAD9C_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:0B06E7FB-3017-4DFD-AC34-CD79475EAD9C_see|text=|trigger=button}{sub-section}{sub-section:0B06E7FB-3017-4DFD-AC34-CD79475EAD9C_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:0B06E7FB-3017-4DFD-AC34-CD79475EAD9C_sam|text=|trigger=button}{sub-section}{sub-section:0B06E7FB-3017-4DFD-AC34-CD79475EAD9C_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=0D64DE5E-1EC2-4F7F-BAF4-7CAEEA9DF1E6}{tr:id=name}{td}h6.mail.smtp.socketFactory.fallback{td}{tr}{tr:id=des}{td}{sub-section:0D64DE5E-1EC2-4F7F-BAF4-7CAEEA9DF1E6_des|text=|trigger=button}{sub-section}{sub-section:0D64DE5E-1EC2-4F7F-BAF4-7CAEEA9DF1E6_des|trigger=none|class=sIndent}If set to true, failure to create a socket using the specified socket factory class will cause the socket to be created using the java.net.Socket class. Defaults to true.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:0D64DE5E-1EC2-4F7F-BAF4-7CAEEA9DF1E6_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:0D64DE5E-1EC2-4F7F-BAF4-7CAEEA9DF1E6_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:0D64DE5E-1EC2-4F7F-BAF4-7CAEEA9DF1E6_ret|text=|trigger=button}{sub-section}{sub-section:0D64DE5E-1EC2-4F7F-BAF4-7CAEEA9DF1E6_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:0D64DE5E-1EC2-4F7F-BAF4-7CAEEA9DF1E6_see|text=|trigger=button}{sub-section}{sub-section:0D64DE5E-1EC2-4F7F-BAF4-7CAEEA9DF1E6_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:0D64DE5E-1EC2-4F7F-BAF4-7CAEEA9DF1E6_see|text=|trigger=button}{sub-section}{sub-section:0D64DE5E-1EC2-4F7F-BAF4-7CAEEA9DF1E6_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:0D64DE5E-1EC2-4F7F-BAF4-7CAEEA9DF1E6_sam|text=|trigger=button}{sub-section}{sub-section:0D64DE5E-1EC2-4F7F-BAF4-7CAEEA9DF1E6_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=B51F7E8B-33EE-4351-A85F-D70BE45F5F57}{tr:id=name}{td}h6.mail.smtp.socketFactory.port{td}{tr}{tr:id=des}{td}{sub-section:B51F7E8B-33EE-4351-A85F-D70BE45F5F57_des|text=|trigger=button}{sub-section}{sub-section:B51F7E8B-33EE-4351-A85F-D70BE45F5F57_des|trigger=none|class=sIndent}Specifies the port to connect to when using the specified socket factory. If not set, the default port will be used.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:B51F7E8B-33EE-4351-A85F-D70BE45F5F57_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B51F7E8B-33EE-4351-A85F-D70BE45F5F57_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:B51F7E8B-33EE-4351-A85F-D70BE45F5F57_ret|text=|trigger=button}{sub-section}{sub-section:B51F7E8B-33EE-4351-A85F-D70BE45F5F57_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B51F7E8B-33EE-4351-A85F-D70BE45F5F57_see|text=|trigger=button}{sub-section}{sub-section:B51F7E8B-33EE-4351-A85F-D70BE45F5F57_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B51F7E8B-33EE-4351-A85F-D70BE45F5F57_see|text=|trigger=button}{sub-section}{sub-section:B51F7E8B-33EE-4351-A85F-D70BE45F5F57_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:B51F7E8B-33EE-4351-A85F-D70BE45F5F57_sam|text=|trigger=button}{sub-section}{sub-section:B51F7E8B-33EE-4351-A85F-D70BE45F5F57_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=7D06E749-37D7-4826-A192-0F8B29481AAD}{tr:id=name}{td}h6.mail.smtp.timeout{td}{tr}{tr:id=des}{td}{sub-section:7D06E749-37D7-4826-A192-0F8B29481AAD_des|text=|trigger=button}{sub-section}{sub-section:7D06E749-37D7-4826-A192-0F8B29481AAD_des|trigger=none|class=sIndent}Socket I/O timeout value in milliseconds. Default is infinite timeout.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:7D06E749-37D7-4826-A192-0F8B29481AAD_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:7D06E749-37D7-4826-A192-0F8B29481AAD_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:7D06E749-37D7-4826-A192-0F8B29481AAD_ret|text=|trigger=button}{sub-section}{sub-section:7D06E749-37D7-4826-A192-0F8B29481AAD_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:7D06E749-37D7-4826-A192-0F8B29481AAD_see|text=|trigger=button}{sub-section}{sub-section:7D06E749-37D7-4826-A192-0F8B29481AAD_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:7D06E749-37D7-4826-A192-0F8B29481AAD_see|text=|trigger=button}{sub-section}{sub-section:7D06E749-37D7-4826-A192-0F8B29481AAD_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:7D06E749-37D7-4826-A192-0F8B29481AAD_sam|text=|trigger=button}{sub-section}{sub-section:7D06E749-37D7-4826-A192-0F8B29481AAD_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=B6E22C82-473E-42BD-AB3B-5465051B7FAC}{tr:id=name}{td}h6.mail.smtp.username{td}{tr}{tr:id=des}{td}{sub-section:B6E22C82-473E-42BD-AB3B-5465051B7FAC_des|text=|trigger=button}{sub-section}{sub-section:B6E22C82-473E-42BD-AB3B-5465051B7FAC_des|trigger=none|class=sIndent}Specify username if using authentication{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:B6E22C82-473E-42BD-AB3B-5465051B7FAC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B6E22C82-473E-42BD-AB3B-5465051B7FAC_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:B6E22C82-473E-42BD-AB3B-5465051B7FAC_ret|text=|trigger=button}{sub-section}{sub-section:B6E22C82-473E-42BD-AB3B-5465051B7FAC_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B6E22C82-473E-42BD-AB3B-5465051B7FAC_see|text=|trigger=button}{sub-section}{sub-section:B6E22C82-473E-42BD-AB3B-5465051B7FAC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B6E22C82-473E-42BD-AB3B-5465051B7FAC_see|text=|trigger=button}{sub-section}{sub-section:B6E22C82-473E-42BD-AB3B-5465051B7FAC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:B6E22C82-473E-42BD-AB3B-5465051B7FAC_sam|text=|trigger=button}{sub-section}{sub-section:B6E22C82-473E-42BD-AB3B-5465051B7FAC_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{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=50C1663E-AB1C-4A20-8ACC-A5ACF36DAC29}{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:50C1663E-AB1C-4A20-8ACC-A5ACF36DAC29_des|text=|trigger=button}{sub-section}{sub-section:50C1663E-AB1C-4A20-8ACC-A5ACF36DAC29_des|trigger=none|class=sIndent}Creates a binary attachment object.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:50C1663E-AB1C-4A20-8ACC-A5ACF36DAC29_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:50C1663E-AB1C-4A20-8ACC-A5ACF36DAC29_prs|trigger=none}filename
binarydata
\[mimeType\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:50C1663E-AB1C-4A20-8ACC-A5ACF36DAC29_ret|text=|trigger=button}{sub-section}{sub-section:50C1663E-AB1C-4A20-8ACC-A5ACF36DAC29_ret|trigger=none|class=sIndent}[Attachment]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:50C1663E-AB1C-4A20-8ACC-A5ACF36DAC29_see|text=|trigger=button}{sub-section}{sub-section:50C1663E-AB1C-4A20-8ACC-A5ACF36DAC29_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:50C1663E-AB1C-4A20-8ACC-A5ACF36DAC29_see|text=|trigger=button}{sub-section}{sub-section:50C1663E-AB1C-4A20-8ACC-A5ACF36DAC29_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:50C1663E-AB1C-4A20-8ACC-A5ACF36DAC29_sam|text=|trigger=button}{sub-section}{sub-section:50C1663E-AB1C-4A20-8ACC-A5ACF36DAC29_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=511BB869-6497-423F-85AD-5A5EEFEC0A03}{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:511BB869-6497-423F-85AD-5A5EEFEC0A03_des|text=|trigger=button}{sub-section}{sub-section:511BB869-6497-423F-85AD-5A5EEFEC0A03_des|trigger=none|class=sIndent}Creates a text based attachment object.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:511BB869-6497-423F-85AD-5A5EEFEC0A03_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:511BB869-6497-423F-85AD-5A5EEFEC0A03_prs|trigger=none}filename
textdata
\[mimeType\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:511BB869-6497-423F-85AD-5A5EEFEC0A03_ret|text=|trigger=button}{sub-section}{sub-section:511BB869-6497-423F-85AD-5A5EEFEC0A03_ret|trigger=none|class=sIndent}[Attachment]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:511BB869-6497-423F-85AD-5A5EEFEC0A03_see|text=|trigger=button}{sub-section}{sub-section:511BB869-6497-423F-85AD-5A5EEFEC0A03_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:511BB869-6497-423F-85AD-5A5EEFEC0A03_see|text=|trigger=button}{sub-section}{sub-section:511BB869-6497-423F-85AD-5A5EEFEC0A03_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:511BB869-6497-423F-85AD-5A5EEFEC0A03_sam|text=|trigger=button}{sub-section}{sub-section:511BB869-6497-423F-85AD-5A5EEFEC0A03_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=8257D3EB-16BB-4389-B030-07E47DF7E783}{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:8257D3EB-16BB-4389-B030-07E47DF7E783_des|text=|trigger=button}{sub-section}{sub-section:8257D3EB-16BB-4389-B030-07E47DF7E783_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:8257D3EB-16BB-4389-B030-07E47DF7E783_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:8257D3EB-16BB-4389-B030-07E47DF7E783_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:8257D3EB-16BB-4389-B030-07E47DF7E783_ret|text=|trigger=button}{sub-section}{sub-section:8257D3EB-16BB-4389-B030-07E47DF7E783_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:8257D3EB-16BB-4389-B030-07E47DF7E783_see|text=|trigger=button}{sub-section}{sub-section:8257D3EB-16BB-4389-B030-07E47DF7E783_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:8257D3EB-16BB-4389-B030-07E47DF7E783_see|text=|trigger=button}{sub-section}{sub-section:8257D3EB-16BB-4389-B030-07E47DF7E783_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:8257D3EB-16BB-4389-B030-07E47DF7E783_sam|text=|trigger=button}{sub-section}{sub-section:8257D3EB-16BB-4389-B030-07E47DF7E783_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=FAB728A1-F62C-4CDD-8989-79FEBF5F96C0}{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:FAB728A1-F62C-4CDD-8989-79FEBF5F96C0_des|text=|trigger=button}{sub-section}{sub-section:FAB728A1-F62C-4CDD-8989-79FEBF5F96C0_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:FAB728A1-F62C-4CDD-8989-79FEBF5F96C0_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:FAB728A1-F62C-4CDD-8989-79FEBF5F96C0_prs|trigger=none}binaryblob/string
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:FAB728A1-F62C-4CDD-8989-79FEBF5F96C0_ret|text=|trigger=button}{sub-section}{sub-section:FAB728A1-F62C-4CDD-8989-79FEBF5F96C0_ret|trigger=none|class=sIndent}[MailMessage]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:FAB728A1-F62C-4CDD-8989-79FEBF5F96C0_see|text=|trigger=button}{sub-section}{sub-section:FAB728A1-F62C-4CDD-8989-79FEBF5F96C0_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:FAB728A1-F62C-4CDD-8989-79FEBF5F96C0_see|text=|trigger=button}{sub-section}{sub-section:FAB728A1-F62C-4CDD-8989-79FEBF5F96C0_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:FAB728A1-F62C-4CDD-8989-79FEBF5F96C0_sam|text=|trigger=button}{sub-section}{sub-section:FAB728A1-F62C-4CDD-8989-79FEBF5F96C0_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=07E0F555-BBAE-4CA2-99C5-720FC310E3BE}{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:07E0F555-BBAE-4CA2-99C5-720FC310E3BE_des|text=|trigger=button}{sub-section}{sub-section:07E0F555-BBAE-4CA2-99C5-720FC310E3BE_des|trigger=none|class=sIndent}Helper method to only get the plain addresses.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:07E0F555-BBAE-4CA2-99C5-720FC310E3BE_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:07E0F555-BBAE-4CA2-99C5-720FC310E3BE_prs|trigger=none}addressesString
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:07E0F555-BBAE-4CA2-99C5-720FC310E3BE_ret|text=|trigger=button}{sub-section}{sub-section:07E0F555-BBAE-4CA2-99C5-720FC310E3BE_ret|trigger=none|class=sIndent}[String]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:07E0F555-BBAE-4CA2-99C5-720FC310E3BE_see|text=|trigger=button}{sub-section}{sub-section:07E0F555-BBAE-4CA2-99C5-720FC310E3BE_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:07E0F555-BBAE-4CA2-99C5-720FC310E3BE_see|text=|trigger=button}{sub-section}{sub-section:07E0F555-BBAE-4CA2-99C5-720FC310E3BE_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:07E0F555-BBAE-4CA2-99C5-720FC310E3BE_sam|text=|trigger=button}{sub-section}{sub-section:07E0F555-BBAE-4CA2-99C5-720FC310E3BE_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=FC4305FF-EAF6-41EE-A054-4C72D99B32FF}{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:FC4305FF-EAF6-41EE-A054-4C72D99B32FF_des|text=|trigger=button}{sub-section}{sub-section:FC4305FF-EAF6-41EE-A054-4C72D99B32FF_des|trigger=none|class=sIndent}Receive mails from pop3 account.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:FC4305FF-EAF6-41EE-A054-4C72D99B32FF_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:FC4305FF-EAF6-41EE-A054-4C72D99B32FF_prs|trigger=none}userName
password
leaveMsgsOnServer
\[receiveMode\]
\[onlyreceiveMsgWithSentDate\]
\[overridePreferencePOP3Host/properties array\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:FC4305FF-EAF6-41EE-A054-4C72D99B32FF_ret|text=|trigger=button}{sub-section}{sub-section:FC4305FF-EAF6-41EE-A054-4C72D99B32FF_ret|trigger=none|class=sIndent}[MailMessage]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:FC4305FF-EAF6-41EE-A054-4C72D99B32FF_see|text=|trigger=button}{sub-section}{sub-section:FC4305FF-EAF6-41EE-A054-4C72D99B32FF_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:FC4305FF-EAF6-41EE-A054-4C72D99B32FF_see|text=|trigger=button}{sub-section}{sub-section:FC4305FF-EAF6-41EE-A054-4C72D99B32FF_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:FC4305FF-EAF6-41EE-A054-4C72D99B32FF_sam|text=|trigger=button}{sub-section}{sub-section:FC4305FF-EAF6-41EE-A054-4C72D99B32FF_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=A45C52A6-4C39-4B30-AE65-B93DC425DD18}{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:A45C52A6-4C39-4B30-AE65-B93DC425DD18_des|text=|trigger=button}{sub-section}{sub-section:A45C52A6-4C39-4B30-AE65-B93DC425DD18_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:A45C52A6-4C39-4B30-AE65-B93DC425DD18_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:A45C52A6-4C39-4B30-AE65-B93DC425DD18_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:A45C52A6-4C39-4B30-AE65-B93DC425DD18_ret|text=|trigger=button}{sub-section}{sub-section:A45C52A6-4C39-4B30-AE65-B93DC425DD18_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:A45C52A6-4C39-4B30-AE65-B93DC425DD18_see|text=|trigger=button}{sub-section}{sub-section:A45C52A6-4C39-4B30-AE65-B93DC425DD18_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:A45C52A6-4C39-4B30-AE65-B93DC425DD18_see|text=|trigger=button}{sub-section}{sub-section:A45C52A6-4C39-4B30-AE65-B93DC425DD18_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:A45C52A6-4C39-4B30-AE65-B93DC425DD18_sam|text=|trigger=button}{sub-section}{sub-section:A45C52A6-4C39-4B30-AE65-B93DC425DD18_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}