{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=2CF6E77F-C099-4BB1-8815-2B4A58A09717}{tr:id=name}{td}h6.mail.development.override.address{td}{tr}{tr:id=des}{td}{sub-section:2CF6E77F-C099-4BB1-8815-2B4A58A09717_des|text=|trigger=button}{sub-section}{sub-section:2CF6E77F-C099-4BB1-8815-2B4A58A09717_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:2CF6E77F-C099-4BB1-8815-2B4A58A09717_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:2CF6E77F-C099-4BB1-8815-2B4A58A09717_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:2CF6E77F-C099-4BB1-8815-2B4A58A09717_ret|text=|trigger=button}{sub-section}{sub-section:2CF6E77F-C099-4BB1-8815-2B4A58A09717_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:2CF6E77F-C099-4BB1-8815-2B4A58A09717_see|text=|trigger=button}{sub-section}{sub-section:2CF6E77F-C099-4BB1-8815-2B4A58A09717_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:2CF6E77F-C099-4BB1-8815-2B4A58A09717_see|text=|trigger=button}{sub-section}{sub-section:2CF6E77F-C099-4BB1-8815-2B4A58A09717_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:2CF6E77F-C099-4BB1-8815-2B4A58A09717_sam|text=|trigger=button}{sub-section}{sub-section:2CF6E77F-C099-4BB1-8815-2B4A58A09717_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=00B273DF-BC1C-4D74-A6F1-ABD6703B3AB9}{tr:id=name}{td}h6.mail.mime.charset{td}{tr}{tr:id=des}{td}{sub-section:00B273DF-BC1C-4D74-A6F1-ABD6703B3AB9_des|text=|trigger=button}{sub-section}{sub-section:00B273DF-BC1C-4D74-A6F1-ABD6703B3AB9_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:00B273DF-BC1C-4D74-A6F1-ABD6703B3AB9_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:00B273DF-BC1C-4D74-A6F1-ABD6703B3AB9_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:00B273DF-BC1C-4D74-A6F1-ABD6703B3AB9_ret|text=|trigger=button}{sub-section}{sub-section:00B273DF-BC1C-4D74-A6F1-ABD6703B3AB9_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:00B273DF-BC1C-4D74-A6F1-ABD6703B3AB9_see|text=|trigger=button}{sub-section}{sub-section:00B273DF-BC1C-4D74-A6F1-ABD6703B3AB9_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:00B273DF-BC1C-4D74-A6F1-ABD6703B3AB9_see|text=|trigger=button}{sub-section}{sub-section:00B273DF-BC1C-4D74-A6F1-ABD6703B3AB9_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:00B273DF-BC1C-4D74-A6F1-ABD6703B3AB9_sam|text=|trigger=button}{sub-section}{sub-section:00B273DF-BC1C-4D74-A6F1-ABD6703B3AB9_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=D470A13E-A860-42CA-8546-B9F6F80B4AD1}{tr:id=name}{td}h6.mail.pop3.apop.enable{td}{tr}{tr:id=des}{td}{sub-section:D470A13E-A860-42CA-8546-B9F6F80B4AD1_des|text=|trigger=button}{sub-section}{sub-section:D470A13E-A860-42CA-8546-B9F6F80B4AD1_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:D470A13E-A860-42CA-8546-B9F6F80B4AD1_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:D470A13E-A860-42CA-8546-B9F6F80B4AD1_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:D470A13E-A860-42CA-8546-B9F6F80B4AD1_ret|text=|trigger=button}{sub-section}{sub-section:D470A13E-A860-42CA-8546-B9F6F80B4AD1_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:D470A13E-A860-42CA-8546-B9F6F80B4AD1_see|text=|trigger=button}{sub-section}{sub-section:D470A13E-A860-42CA-8546-B9F6F80B4AD1_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:D470A13E-A860-42CA-8546-B9F6F80B4AD1_see|text=|trigger=button}{sub-section}{sub-section:D470A13E-A860-42CA-8546-B9F6F80B4AD1_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:D470A13E-A860-42CA-8546-B9F6F80B4AD1_sam|text=|trigger=button}{sub-section}{sub-section:D470A13E-A860-42CA-8546-B9F6F80B4AD1_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=846569FA-0B42-47D0-9DBA-B0D98FE252BC}{tr:id=name}{td}h6.mail.pop3.host{td}{tr}{tr:id=des}{td}{sub-section:846569FA-0B42-47D0-9DBA-B0D98FE252BC_des|text=|trigger=button}{sub-section}{sub-section:846569FA-0B42-47D0-9DBA-B0D98FE252BC_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:846569FA-0B42-47D0-9DBA-B0D98FE252BC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:846569FA-0B42-47D0-9DBA-B0D98FE252BC_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:846569FA-0B42-47D0-9DBA-B0D98FE252BC_ret|text=|trigger=button}{sub-section}{sub-section:846569FA-0B42-47D0-9DBA-B0D98FE252BC_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:846569FA-0B42-47D0-9DBA-B0D98FE252BC_see|text=|trigger=button}{sub-section}{sub-section:846569FA-0B42-47D0-9DBA-B0D98FE252BC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:846569FA-0B42-47D0-9DBA-B0D98FE252BC_see|text=|trigger=button}{sub-section}{sub-section:846569FA-0B42-47D0-9DBA-B0D98FE252BC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:846569FA-0B42-47D0-9DBA-B0D98FE252BC_sam|text=|trigger=button}{sub-section}{sub-section:846569FA-0B42-47D0-9DBA-B0D98FE252BC_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=3C7C7F2B-A2AF-4C6D-8AEC-A329B7029867}{tr:id=name}{td}h6.mail.smtp.auth{td}{tr}{tr:id=des}{td}{sub-section:3C7C7F2B-A2AF-4C6D-8AEC-A329B7029867_des|text=|trigger=button}{sub-section}{sub-section:3C7C7F2B-A2AF-4C6D-8AEC-A329B7029867_des|trigger=none|class=sIndent}Use authentication (true/false){sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:3C7C7F2B-A2AF-4C6D-8AEC-A329B7029867_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:3C7C7F2B-A2AF-4C6D-8AEC-A329B7029867_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:3C7C7F2B-A2AF-4C6D-8AEC-A329B7029867_ret|text=|trigger=button}{sub-section}{sub-section:3C7C7F2B-A2AF-4C6D-8AEC-A329B7029867_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:3C7C7F2B-A2AF-4C6D-8AEC-A329B7029867_see|text=|trigger=button}{sub-section}{sub-section:3C7C7F2B-A2AF-4C6D-8AEC-A329B7029867_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:3C7C7F2B-A2AF-4C6D-8AEC-A329B7029867_see|text=|trigger=button}{sub-section}{sub-section:3C7C7F2B-A2AF-4C6D-8AEC-A329B7029867_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:3C7C7F2B-A2AF-4C6D-8AEC-A329B7029867_sam|text=|trigger=button}{sub-section}{sub-section:3C7C7F2B-A2AF-4C6D-8AEC-A329B7029867_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=AB82E3B3-6FF6-4D9A-82F8-A4FA6FD8FA10}{tr:id=name}{td}h6.mail.smtp.connectiontimeout{td}{tr}{tr:id=des}{td}{sub-section:AB82E3B3-6FF6-4D9A-82F8-A4FA6FD8FA10_des|text=|trigger=button}{sub-section}{sub-section:AB82E3B3-6FF6-4D9A-82F8-A4FA6FD8FA10_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:AB82E3B3-6FF6-4D9A-82F8-A4FA6FD8FA10_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:AB82E3B3-6FF6-4D9A-82F8-A4FA6FD8FA10_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:AB82E3B3-6FF6-4D9A-82F8-A4FA6FD8FA10_ret|text=|trigger=button}{sub-section}{sub-section:AB82E3B3-6FF6-4D9A-82F8-A4FA6FD8FA10_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:AB82E3B3-6FF6-4D9A-82F8-A4FA6FD8FA10_see|text=|trigger=button}{sub-section}{sub-section:AB82E3B3-6FF6-4D9A-82F8-A4FA6FD8FA10_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:AB82E3B3-6FF6-4D9A-82F8-A4FA6FD8FA10_see|text=|trigger=button}{sub-section}{sub-section:AB82E3B3-6FF6-4D9A-82F8-A4FA6FD8FA10_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:AB82E3B3-6FF6-4D9A-82F8-A4FA6FD8FA10_sam|text=|trigger=button}{sub-section}{sub-section:AB82E3B3-6FF6-4D9A-82F8-A4FA6FD8FA10_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=7A0F111D-AC72-4BC7-A521-353C0BE4955E}{tr:id=name}{td}h6.mail.smtp.host{td}{tr}{tr:id=des}{td}{sub-section:7A0F111D-AC72-4BC7-A521-353C0BE4955E_des|text=|trigger=button}{sub-section}{sub-section:7A0F111D-AC72-4BC7-A521-353C0BE4955E_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:7A0F111D-AC72-4BC7-A521-353C0BE4955E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:7A0F111D-AC72-4BC7-A521-353C0BE4955E_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:7A0F111D-AC72-4BC7-A521-353C0BE4955E_ret|text=|trigger=button}{sub-section}{sub-section:7A0F111D-AC72-4BC7-A521-353C0BE4955E_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:7A0F111D-AC72-4BC7-A521-353C0BE4955E_see|text=|trigger=button}{sub-section}{sub-section:7A0F111D-AC72-4BC7-A521-353C0BE4955E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:7A0F111D-AC72-4BC7-A521-353C0BE4955E_see|text=|trigger=button}{sub-section}{sub-section:7A0F111D-AC72-4BC7-A521-353C0BE4955E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:7A0F111D-AC72-4BC7-A521-353C0BE4955E_sam|text=|trigger=button}{sub-section}{sub-section:7A0F111D-AC72-4BC7-A521-353C0BE4955E_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=A424BC4A-826C-4E74-AC56-86E373AE8264}{tr:id=name}{td}h6.mail.smtp.password{td}{tr}{tr:id=des}{td}{sub-section:A424BC4A-826C-4E74-AC56-86E373AE8264_des|text=|trigger=button}{sub-section}{sub-section:A424BC4A-826C-4E74-AC56-86E373AE8264_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:A424BC4A-826C-4E74-AC56-86E373AE8264_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:A424BC4A-826C-4E74-AC56-86E373AE8264_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:A424BC4A-826C-4E74-AC56-86E373AE8264_ret|text=|trigger=button}{sub-section}{sub-section:A424BC4A-826C-4E74-AC56-86E373AE8264_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:A424BC4A-826C-4E74-AC56-86E373AE8264_see|text=|trigger=button}{sub-section}{sub-section:A424BC4A-826C-4E74-AC56-86E373AE8264_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:A424BC4A-826C-4E74-AC56-86E373AE8264_see|text=|trigger=button}{sub-section}{sub-section:A424BC4A-826C-4E74-AC56-86E373AE8264_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:A424BC4A-826C-4E74-AC56-86E373AE8264_sam|text=|trigger=button}{sub-section}{sub-section:A424BC4A-826C-4E74-AC56-86E373AE8264_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=8CBE965F-5C84-45C3-93E3-63A64E114440}{tr:id=name}{td}h6.mail.smtp.socketFactory.class{td}{tr}{tr:id=des}{td}{sub-section:8CBE965F-5C84-45C3-93E3-63A64E114440_des|text=|trigger=button}{sub-section}{sub-section:8CBE965F-5C84-45C3-93E3-63A64E114440_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:8CBE965F-5C84-45C3-93E3-63A64E114440_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:8CBE965F-5C84-45C3-93E3-63A64E114440_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:8CBE965F-5C84-45C3-93E3-63A64E114440_ret|text=|trigger=button}{sub-section}{sub-section:8CBE965F-5C84-45C3-93E3-63A64E114440_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:8CBE965F-5C84-45C3-93E3-63A64E114440_see|text=|trigger=button}{sub-section}{sub-section:8CBE965F-5C84-45C3-93E3-63A64E114440_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:8CBE965F-5C84-45C3-93E3-63A64E114440_see|text=|trigger=button}{sub-section}{sub-section:8CBE965F-5C84-45C3-93E3-63A64E114440_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:8CBE965F-5C84-45C3-93E3-63A64E114440_sam|text=|trigger=button}{sub-section}{sub-section:8CBE965F-5C84-45C3-93E3-63A64E114440_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=BF09D1DF-CD48-40B1-BC3E-19660856B685}{tr:id=name}{td}h6.mail.smtp.socketFactory.fallback{td}{tr}{tr:id=des}{td}{sub-section:BF09D1DF-CD48-40B1-BC3E-19660856B685_des|text=|trigger=button}{sub-section}{sub-section:BF09D1DF-CD48-40B1-BC3E-19660856B685_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:BF09D1DF-CD48-40B1-BC3E-19660856B685_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:BF09D1DF-CD48-40B1-BC3E-19660856B685_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:BF09D1DF-CD48-40B1-BC3E-19660856B685_ret|text=|trigger=button}{sub-section}{sub-section:BF09D1DF-CD48-40B1-BC3E-19660856B685_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:BF09D1DF-CD48-40B1-BC3E-19660856B685_see|text=|trigger=button}{sub-section}{sub-section:BF09D1DF-CD48-40B1-BC3E-19660856B685_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:BF09D1DF-CD48-40B1-BC3E-19660856B685_see|text=|trigger=button}{sub-section}{sub-section:BF09D1DF-CD48-40B1-BC3E-19660856B685_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:BF09D1DF-CD48-40B1-BC3E-19660856B685_sam|text=|trigger=button}{sub-section}{sub-section:BF09D1DF-CD48-40B1-BC3E-19660856B685_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=88FEE026-817D-4B1A-94CA-DD1E03F9C9BE}{tr:id=name}{td}h6.mail.smtp.socketFactory.port{td}{tr}{tr:id=des}{td}{sub-section:88FEE026-817D-4B1A-94CA-DD1E03F9C9BE_des|text=|trigger=button}{sub-section}{sub-section:88FEE026-817D-4B1A-94CA-DD1E03F9C9BE_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:88FEE026-817D-4B1A-94CA-DD1E03F9C9BE_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:88FEE026-817D-4B1A-94CA-DD1E03F9C9BE_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:88FEE026-817D-4B1A-94CA-DD1E03F9C9BE_ret|text=|trigger=button}{sub-section}{sub-section:88FEE026-817D-4B1A-94CA-DD1E03F9C9BE_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:88FEE026-817D-4B1A-94CA-DD1E03F9C9BE_see|text=|trigger=button}{sub-section}{sub-section:88FEE026-817D-4B1A-94CA-DD1E03F9C9BE_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:88FEE026-817D-4B1A-94CA-DD1E03F9C9BE_see|text=|trigger=button}{sub-section}{sub-section:88FEE026-817D-4B1A-94CA-DD1E03F9C9BE_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:88FEE026-817D-4B1A-94CA-DD1E03F9C9BE_sam|text=|trigger=button}{sub-section}{sub-section:88FEE026-817D-4B1A-94CA-DD1E03F9C9BE_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=B364EBB4-A7D3-415C-BADD-B27C60D24E19}{tr:id=name}{td}h6.mail.smtp.timeout{td}{tr}{tr:id=des}{td}{sub-section:B364EBB4-A7D3-415C-BADD-B27C60D24E19_des|text=|trigger=button}{sub-section}{sub-section:B364EBB4-A7D3-415C-BADD-B27C60D24E19_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:B364EBB4-A7D3-415C-BADD-B27C60D24E19_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:B364EBB4-A7D3-415C-BADD-B27C60D24E19_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:B364EBB4-A7D3-415C-BADD-B27C60D24E19_ret|text=|trigger=button}{sub-section}{sub-section:B364EBB4-A7D3-415C-BADD-B27C60D24E19_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:B364EBB4-A7D3-415C-BADD-B27C60D24E19_see|text=|trigger=button}{sub-section}{sub-section:B364EBB4-A7D3-415C-BADD-B27C60D24E19_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:B364EBB4-A7D3-415C-BADD-B27C60D24E19_see|text=|trigger=button}{sub-section}{sub-section:B364EBB4-A7D3-415C-BADD-B27C60D24E19_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:B364EBB4-A7D3-415C-BADD-B27C60D24E19_sam|text=|trigger=button}{sub-section}{sub-section:B364EBB4-A7D3-415C-BADD-B27C60D24E19_sam|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=DA572DAE-2E76-4609-B31C-62A456D13D82}{tr:id=name}{td}h6.mail.smtp.username{td}{tr}{tr:id=des}{td}{sub-section:DA572DAE-2E76-4609-B31C-62A456D13D82_des|text=|trigger=button}{sub-section}{sub-section:DA572DAE-2E76-4609-B31C-62A456D13D82_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:DA572DAE-2E76-4609-B31C-62A456D13D82_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:DA572DAE-2E76-4609-B31C-62A456D13D82_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=ret}{td}*Returns*\\{sub-section:DA572DAE-2E76-4609-B31C-62A456D13D82_ret|text=|trigger=button}{sub-section}{sub-section:DA572DAE-2E76-4609-B31C-62A456D13D82_ret|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:DA572DAE-2E76-4609-B31C-62A456D13D82_see|text=|trigger=button}{sub-section}{sub-section:DA572DAE-2E76-4609-B31C-62A456D13D82_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:DA572DAE-2E76-4609-B31C-62A456D13D82_see|text=|trigger=button}{sub-section}{sub-section:DA572DAE-2E76-4609-B31C-62A456D13D82_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=sam}{td}*Sample*\\{sub-section:DA572DAE-2E76-4609-B31C-62A456D13D82_sam|text=|trigger=button}{sub-section}{sub-section:DA572DAE-2E76-4609-B31C-62A456D13D82_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=31C0AB06-8FB2-44E4-9F35-070D710F250E}{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:31C0AB06-8FB2-44E4-9F35-070D710F250E_des|text=|trigger=button}{sub-section}{sub-section:31C0AB06-8FB2-44E4-9F35-070D710F250E_des|trigger=none|class=sIndent}Creates a binary attachment object.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:31C0AB06-8FB2-44E4-9F35-070D710F250E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:31C0AB06-8FB2-44E4-9F35-070D710F250E_prs|trigger=none}filename
binarydata
\[mimeType\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:31C0AB06-8FB2-44E4-9F35-070D710F250E_ret|text=|trigger=button}{sub-section}{sub-section:31C0AB06-8FB2-44E4-9F35-070D710F250E_ret|trigger=none|class=sIndent}[Attachment]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:31C0AB06-8FB2-44E4-9F35-070D710F250E_see|text=|trigger=button}{sub-section}{sub-section:31C0AB06-8FB2-44E4-9F35-070D710F250E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:31C0AB06-8FB2-44E4-9F35-070D710F250E_see|text=|trigger=button}{sub-section}{sub-section:31C0AB06-8FB2-44E4-9F35-070D710F250E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:31C0AB06-8FB2-44E4-9F35-070D710F250E_sam|text=|trigger=button}{sub-section}{sub-section:31C0AB06-8FB2-44E4-9F35-070D710F250E_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=8936B1A7-F8E8-4EA3-B248-6F83AE3ADCD3}{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:8936B1A7-F8E8-4EA3-B248-6F83AE3ADCD3_des|text=|trigger=button}{sub-section}{sub-section:8936B1A7-F8E8-4EA3-B248-6F83AE3ADCD3_des|trigger=none|class=sIndent}Creates a text based attachment object.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:8936B1A7-F8E8-4EA3-B248-6F83AE3ADCD3_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:8936B1A7-F8E8-4EA3-B248-6F83AE3ADCD3_prs|trigger=none}filename
textdata
\[mimeType\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:8936B1A7-F8E8-4EA3-B248-6F83AE3ADCD3_ret|text=|trigger=button}{sub-section}{sub-section:8936B1A7-F8E8-4EA3-B248-6F83AE3ADCD3_ret|trigger=none|class=sIndent}[Attachment]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:8936B1A7-F8E8-4EA3-B248-6F83AE3ADCD3_see|text=|trigger=button}{sub-section}{sub-section:8936B1A7-F8E8-4EA3-B248-6F83AE3ADCD3_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:8936B1A7-F8E8-4EA3-B248-6F83AE3ADCD3_see|text=|trigger=button}{sub-section}{sub-section:8936B1A7-F8E8-4EA3-B248-6F83AE3ADCD3_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:8936B1A7-F8E8-4EA3-B248-6F83AE3ADCD3_sam|text=|trigger=button}{sub-section}{sub-section:8936B1A7-F8E8-4EA3-B248-6F83AE3ADCD3_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=855DDCFC-7C4F-48D8-B3AF-59E98B1CCC18}{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:855DDCFC-7C4F-48D8-B3AF-59E98B1CCC18_des|text=|trigger=button}{sub-section}{sub-section:855DDCFC-7C4F-48D8-B3AF-59E98B1CCC18_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:855DDCFC-7C4F-48D8-B3AF-59E98B1CCC18_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:855DDCFC-7C4F-48D8-B3AF-59E98B1CCC18_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:855DDCFC-7C4F-48D8-B3AF-59E98B1CCC18_ret|text=|trigger=button}{sub-section}{sub-section:855DDCFC-7C4F-48D8-B3AF-59E98B1CCC18_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:855DDCFC-7C4F-48D8-B3AF-59E98B1CCC18_see|text=|trigger=button}{sub-section}{sub-section:855DDCFC-7C4F-48D8-B3AF-59E98B1CCC18_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:855DDCFC-7C4F-48D8-B3AF-59E98B1CCC18_see|text=|trigger=button}{sub-section}{sub-section:855DDCFC-7C4F-48D8-B3AF-59E98B1CCC18_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:855DDCFC-7C4F-48D8-B3AF-59E98B1CCC18_sam|text=|trigger=button}{sub-section}{sub-section:855DDCFC-7C4F-48D8-B3AF-59E98B1CCC18_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=78F3AE84-6F92-4E61-9D8E-DFB4C44B290E}{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:78F3AE84-6F92-4E61-9D8E-DFB4C44B290E_des|text=|trigger=button}{sub-section}{sub-section:78F3AE84-6F92-4E61-9D8E-DFB4C44B290E_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:78F3AE84-6F92-4E61-9D8E-DFB4C44B290E_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:78F3AE84-6F92-4E61-9D8E-DFB4C44B290E_prs|trigger=none}binaryblob/string
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:78F3AE84-6F92-4E61-9D8E-DFB4C44B290E_ret|text=|trigger=button}{sub-section}{sub-section:78F3AE84-6F92-4E61-9D8E-DFB4C44B290E_ret|trigger=none|class=sIndent}[MailMessage]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:78F3AE84-6F92-4E61-9D8E-DFB4C44B290E_see|text=|trigger=button}{sub-section}{sub-section:78F3AE84-6F92-4E61-9D8E-DFB4C44B290E_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:78F3AE84-6F92-4E61-9D8E-DFB4C44B290E_see|text=|trigger=button}{sub-section}{sub-section:78F3AE84-6F92-4E61-9D8E-DFB4C44B290E_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:78F3AE84-6F92-4E61-9D8E-DFB4C44B290E_sam|text=|trigger=button}{sub-section}{sub-section:78F3AE84-6F92-4E61-9D8E-DFB4C44B290E_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=E8A96475-86E3-46B6-8716-D7377062C932}{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:E8A96475-86E3-46B6-8716-D7377062C932_des|text=|trigger=button}{sub-section}{sub-section:E8A96475-86E3-46B6-8716-D7377062C932_des|trigger=none|class=sIndent}Helper method to only get the plain addresses.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:E8A96475-86E3-46B6-8716-D7377062C932_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:E8A96475-86E3-46B6-8716-D7377062C932_prs|trigger=none}addressesString
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:E8A96475-86E3-46B6-8716-D7377062C932_ret|text=|trigger=button}{sub-section}{sub-section:E8A96475-86E3-46B6-8716-D7377062C932_ret|trigger=none|class=sIndent}[String]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:E8A96475-86E3-46B6-8716-D7377062C932_see|text=|trigger=button}{sub-section}{sub-section:E8A96475-86E3-46B6-8716-D7377062C932_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:E8A96475-86E3-46B6-8716-D7377062C932_see|text=|trigger=button}{sub-section}{sub-section:E8A96475-86E3-46B6-8716-D7377062C932_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:E8A96475-86E3-46B6-8716-D7377062C932_sam|text=|trigger=button}{sub-section}{sub-section:E8A96475-86E3-46B6-8716-D7377062C932_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=1C48D5A1-7744-44CB-956F-E3CE3177FDAC}{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:1C48D5A1-7744-44CB-956F-E3CE3177FDAC_des|text=|trigger=button}{sub-section}{sub-section:1C48D5A1-7744-44CB-956F-E3CE3177FDAC_des|trigger=none|class=sIndent}Receive mails from pop3 account.{sub-section}{td}{tr}{tr:id=prs}{td}*Parameters*\\{sub-section:1C48D5A1-7744-44CB-956F-E3CE3177FDAC_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:1C48D5A1-7744-44CB-956F-E3CE3177FDAC_prs|trigger=none}userName
password
leaveMsgsOnServer
\[receiveMode\]
\[onlyreceiveMsgWithSentDate\]
\[overridePreferencePOP3Host/properties array\]
{sub-section}{div}{td}{tr}{tr:id=ret}{td}*Returns*\\{sub-section:1C48D5A1-7744-44CB-956F-E3CE3177FDAC_ret|text=|trigger=button}{sub-section}{sub-section:1C48D5A1-7744-44CB-956F-E3CE3177FDAC_ret|trigger=none|class=sIndent}[MailMessage]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:1C48D5A1-7744-44CB-956F-E3CE3177FDAC_see|text=|trigger=button}{sub-section}{sub-section:1C48D5A1-7744-44CB-956F-E3CE3177FDAC_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:1C48D5A1-7744-44CB-956F-E3CE3177FDAC_see|text=|trigger=button}{sub-section}{sub-section:1C48D5A1-7744-44CB-956F-E3CE3177FDAC_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:1C48D5A1-7744-44CB-956F-E3CE3177FDAC_sam|text=|trigger=button}{sub-section}{sub-section:1C48D5A1-7744-44CB-956F-E3CE3177FDAC_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=2ACE4705-266E-454A-B9A4-4EA8B58EBE60}{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:2ACE4705-266E-454A-B9A4-4EA8B58EBE60_des|text=|trigger=button}{sub-section}{sub-section:2ACE4705-266E-454A-B9A4-4EA8B58EBE60_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:2ACE4705-266E-454A-B9A4-4EA8B58EBE60_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:2ACE4705-266E-454A-B9A4-4EA8B58EBE60_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:2ACE4705-266E-454A-B9A4-4EA8B58EBE60_ret|text=|trigger=button}{sub-section}{sub-section:2ACE4705-266E-454A-B9A4-4EA8B58EBE60_ret|trigger=none|class=sIndent}[Boolean]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:2ACE4705-266E-454A-B9A4-4EA8B58EBE60_see|text=|trigger=button}{sub-section}{sub-section:2ACE4705-266E-454A-B9A4-4EA8B58EBE60_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:2ACE4705-266E-454A-B9A4-4EA8B58EBE60_see|text=|trigger=button}{sub-section}{sub-section:2ACE4705-266E-454A-B9A4-4EA8B58EBE60_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:2ACE4705-266E-454A-B9A4-4EA8B58EBE60_sam|text=|trigger=button}{sub-section}{sub-section:2ACE4705-266E-454A-B9A4-4EA8B58EBE60_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}