Page History
Wiki Markup |
---|
{div:style=display:none} DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING. THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR{div} {div:id=description}*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}{div}\\ {table:id=|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:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[Attachment]{td}{td}[#createBinaryAttachment]\(filename, binarydata) Creates a binary attachment object.{td}{tr}{tbody}{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) Creates a text based attachment objec with the default 'text/plain' mimetype{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}[Boolean]{td}{td}[#isValidEmailAddress]\(email) Checks whether the given e\-mail address is valid or not.{td}{tr}{tbody}{tbody}{tr}{td}[MailMessage]\[]{td}{td}[#receiveMail]\(username, password, leaveMsgsOnServer) Receive mails from pop3 account.{td}{tr}{tbody}{tbody}{tr}{td}[MailMessage]\[]{td}{td}[#receiveMail]\(username, password, leaveMsgsOnServer, receiveMode) Receive mails from pop3 account.{td}{tr}{tbody}{tbody}{tr}{td}[MailMessage]\[]{td}{td}[#receiveMail]\(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate) Receive mails from pop3 account.{td}{tr}{tbody}{tbody}{tr}{td}[MailMessage]\[]{td}{td}[#receiveMail]\(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate, pop3Host) Receive mails from pop3 account.{td}{tr}{tbody}{tbody}{tr}{td}[MailMessage]\[]{td}{td}[#receiveMail]\(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate, properties) Receive mails from pop3 account.{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#sendBulkMail]\(to, from, subject, msgText) Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#sendBulkMail]\(to, from, subject, msgText, cc) Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#sendBulkMail]\(to, from, subject, msgText, cc, bcc) Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#sendBulkMail]\(to, from, subject, msgText, cc, bcc, attachment) Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#sendBulkMail]\(to, from, subject, msgText, cc, bcc, attachment, smtpHost) Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#sendBulkMail]\(to, from, subject, msgText, cc, bcc, attachment, overrideProperties) Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#sendBulkMail]\(to, from, subject, msgText, cc, bcc, attachments) Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#sendBulkMail]\(to, from, subject, msgText, cc, bcc, attachments, smtpHost) Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#sendBulkMail]\(to, from, subject, msgText, cc, bcc, attachments, overrideProperties) Send a bulk mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#sendMail]\(to, from, subject, msgText) Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#sendMail]\(to, from, subject, msgText, cc) Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#sendMail]\(to, from, subject, msgText, cc, bcc) Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#sendMail]\(to, from, subject, msgText, cc, bcc, attachment) Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#sendMail]\(to, from, subject, msgText, cc, bcc, attachment, smtpHost) Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#sendMail]\(to, from, subject, msgText, cc, bcc, attachment, overrideProperties) Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#sendMail]\(to, from, subject, msgText, cc, bcc, attachments) Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#sendMail]\(to, from, subject, msgText, cc, bcc, attachments, smtpHost) Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).{td}{tr}{tbody}{tbody}{tr}{td}[Boolean]{td}{td}[#sendMail]\(to, from, subject, msgText, cc, bcc, attachments, overrideProperties) Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting).{td}{tr}{tbody}{table}\\ {table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=createBinaryAttachment-String_byteArray}{tr:id=name}{td}h6.createBinaryAttachment{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Attachment]{span}{span:style=font-weight: bold;}createBinaryAttachment{span}{span}\(filename, binarydata){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} filename \{byte[]} binarydata {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Attachment]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=createBinaryAttachment-String_byteArray_String}{tr:id=name}{td}h6.createBinaryAttachment{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Attachment]{span}{span:style=font-weight: bold;}createBinaryAttachment{span}{span}\(filename, binarydata, mimeType){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} filename \{byte[]} binarydata \{[String]} mimeType {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Attachment]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var attachment1 = plugins.mail.createBinaryAttachment('logo1.gif',plugins.file.readFile('c:/temp/a_logo.gif', 'image/gif')); var attachment2 = plugins.mail.createBinaryAttachment('logo2.gif',plugins.file.readFile('c:/temp/another_logo.gif', 'image/gif')); var success = plugins.mail.sendMail('[email protected]', 'John Cobb <[email protected]>', 'subject', 'msgText',null,null,new Array(attachment1,attachment2)); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=createTextAttachment-String_String}{tr:id=name}{td}h6.createTextAttachment{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Attachment]{span}{span:style=font-weight: bold;}createTextAttachment{span}{span}\(filename, textdata){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} filename \{[String]} textdata {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Attachment]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var attachment = plugins.mail.createTextAttachment('readme.html','<html>bla bla bla'); var success = plugins.mail.sendMail('[email protected]', 'John Cobb <[email protected]>', 'subject', 'msgText',null,null,attachment); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=createTextAttachment-String_String_String}{tr:id=name}{td}h6.createTextAttachment{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Attachment]{span}{span:style=font-weight: bold;}createTextAttachment{span}{span}\(filename, textdata, mimeType){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} filename \{[String]} textdata \{[String]} mimeType {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Attachment]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getLastSendMailExceptionMsg}{tr:id=name}{td}h6.getLastSendMailExceptionMsg{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}getLastSendMailExceptionMsg{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getMailMessage-}{tr:id=name}{td}h6.getMailMessage{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[MailMessage]{span}{span:style=font-weight: bold;}getMailMessage{span}{span}\(binaryblob/string){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}binaryblob/string {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[MailMessage]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var msg = plugins.mail.getMailMessage(myBlob); if (msg != null) //if is null error occurred! { application.output(msg.getFromAddresses()) } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getPlainMailAddresses-}{tr:id=name}{td}h6.getPlainMailAddresses{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]\[]{span}{span:style=font-weight: bold;}getPlainMailAddresses{span}{span}\(addressesString){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}addressesString {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]\[]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=isValidEmailAddress-String}{tr:id=name}{td}h6.isValidEmailAddress{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}isValidEmailAddress{span}{span}\(email){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} email {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} plugins.mail.isValidEmailAddress("[email protected]"); {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=receiveMail-String_String_Boolean}{tr:id=name}{td}h6.receiveMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[MailMessage]\[]{span}{span:style=font-weight: bold;}receiveMail{span}{span}\(username, password, leaveMsgsOnServer){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} username \{[String]} password \{[Boolean]} leaveMsgsOnServer {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[MailMessage]\[]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var msgs = plugins.mail.receiveMail('mylogin', 'secretpass', true); if (msgs != null) //if is null error occurred! { for (var i = 0 ; i < msgs.length ; i++) { var msg = msgs[i] application.output(msg.getFromAddresses()) application.output(msg.getRecipientAddresses()) application.output(msg.getReplyAddresses()) application.output(msg.getSentDate()) application.output(msg.getHeaders()) application.output(msg.getSubject()) application.output(msg.getHtmlMsg()) application.output(msg.getPlainMsg()) var attachments = msg.getAttachments() if (attachments != null) { for (var j = 0 ; j < attachments.length ; j++) { var attachment = attachments[j] application.output(attachment.getName()) var attachmentDataByteArray = attachment.getData() //write attachmentDataByteArray to a file... } } } } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=receiveMail-String_String_Boolean_Number}{tr:id=name}{td}h6.receiveMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[MailMessage]\[]{span}{span:style=font-weight: bold;}receiveMail{span}{span}\(username, password, leaveMsgsOnServer, receiveMode){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} username \{[String]} password \{[Boolean]} leaveMsgsOnServer \{[Number]} receiveMode {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[MailMessage]\[]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var receiveMode = 1;//0=FULL,1=HEADERS_ONLY,2=NO_ATTACHMENTS var msgs = plugins.mail.receiveMail('mylogin', 'secretpass', true, 0); if (msgs != null) //if is null error occurred! { for (var i = 0 ; i < msgs.length ; i++) { var msg = msgs[i] application.output(msg.getFromAddresses()) application.output(msg.getRecipientAddresses()) application.output(msg.getReplyAddresses()) application.output(msg.getSentDate()) application.output(msg.getHeaders()) application.output(msg.getSubject()) } } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=receiveMail-String_String_Boolean_Number_Date}{tr:id=name}{td}h6.receiveMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[MailMessage]\[]{span}{span:style=font-weight: bold;}receiveMail{span}{span}\(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} username \{[String]} password \{[Boolean]} leaveMsgsOnServer \{[Number]} receiveMode \{[Date]} onlyReceiveMsgWithSentDate {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[MailMessage]\[]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} //it is also possible to first receive the headers and later receive a full message with particular 'sentdate' //var receiveMode = 1;//0=FULL,1=HEADERS_ONLY,2=NO_ATTACHMENTS var msgs = plugins.mail.receiveMail('mylogin', 'secretpass', true, 0, theSentDateObjectFormPreviousHeaderLoading); if (msgs != null) //if is null error occurred! { for (var i = 0 ; i < msgs.length ; i++) { var msg = msgs[i] application.output(msg.getFromAddresses()) application.output(msg.getRecipientAddresses()) application.output(msg.getReplyAddresses()) application.output(msg.getSentDate()) application.output(msg.getHeaders()) application.output(msg.getSubject()) } } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=receiveMail-String_String_Boolean_Number_Date_String}{tr:id=name}{td}h6.receiveMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[MailMessage]\[]{span}{span:style=font-weight: bold;}receiveMail{span}{span}\(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate, pop3Host){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} username \{[String]} password \{[Boolean]} leaveMsgsOnServer \{[Number]} receiveMode \{[Date]} onlyReceiveMsgWithSentDate \{[String]} pop3Host {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[MailMessage]\[]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} //it is also possible to first receive the headers and later receive a full message var receiveMode = 0;//0=FULL,1=HEADERS_ONLY,2=NO_ATTACHMENTS var pop3Host = 'myserver.com'; var msgs = plugins.mail.receiveMail('mylogin', 'secretpass', true, receiveMode, null, pop3Host); if (msgs != null) //if is null error occurred! { for (var i = 0 ; i < msgs.length ; i++) { var msg = msgs[i] application.output(msg.getFromAddresses()) application.output(msg.getRecipientAddresses()) application.output(msg.getReplyAddresses()) application.output(msg.getSentDate()) application.output(msg.getHeaders()) application.output(msg.getSubject()) application.output(msg.getHtmlMsg()) application.output(msg.getPlainMsg()) var attachments = msg.getAttachments() if (attachments != null) { for (var j = 0 ; j < attachments.length ; j++) { var attachment = attachments[j] application.output(attachment.getName()) var attachmentDataByteArray = attachment.getData() //write attachmentDataByteArray to a file... } } } } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=receiveMail-String_String_Boolean_Number_Date_StringArray}{tr:id=name}{td}h6.receiveMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[MailMessage]\[]{span}{span:style=font-weight: bold;}receiveMail{span}{span}\(username, password, leaveMsgsOnServer, receiveMode, onlyReceiveMsgWithSentDate, properties){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} username \{[String]} password \{[Boolean]} leaveMsgsOnServer \{[Number]} receiveMode \{[Date]} onlyReceiveMsgWithSentDate \{[String]\[]} properties {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[MailMessage]\[]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var receiveMode = 1;//0=FULL,1=HEADERS_ONLY,2=NO_ATTACHMENTS var properties = new Array(); properties[0] = 'mail.pop3.port=995'; properties[1] = 'mail.pop3.ssl.enable=true'; properties[2] = 'mail.pop3.host=myserver.com'; properties[3] = '[email protected]'; var msgs = plugins.mail.receiveMail('mylogin', 'secretpass', true, receiveMode, null, properties); if (msgs != null) //if is null error occurred! { for (var i = 0 ; i < msgs.length ; i++) { var msg = msgs[i] application.output(msg.getFromAddresses()) application.output(msg.getRecipientAddresses()) application.output(msg.getReplyAddresses()) application.output(msg.getSentDate()) application.output(msg.getHeaders()) application.output(msg.getSubject()) } } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendBulkMail-String_String_String_String}{tr:id=name}{td}h6.sendBulkMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}sendBulkMail{span}{span}\(to, from, subject, msgText){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} to -- A string containing 1 or multiple addresses seperated by a comma. \{[String]} from -- A string containing an address and an optional reply address, seperated by a comma. \{[String]} subject -- The subject of the bulk mail \{[String]} msgText -- The message text {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>'; var success = plugins.mail.sendBulkMail('[email protected],[email protected]', 'John Cobb <[email protected]>,[email protected]', 'subject', msgText); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendBulkMail-String_String_String_String_String}{tr:id=name}{td}h6.sendBulkMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}sendBulkMail{span}{span}\(to, from, subject, msgText, cc){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} to -- A string containing 1 or multiple addresses seperated by a comma. \{[String]} from -- A string containing an address and an optional reply address, seperated by a comma. \{[String]} subject -- The subject of the bulk mail \{[String]} msgText -- The message text \{[String]} cc -- One or more addresses seperated by a comma {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>'; var success = plugins.mail.sendBulkMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,'[email protected],[email protected]'); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendBulkMail-String_String_String_String_String_String}{tr:id=name}{td}h6.sendBulkMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}sendBulkMail{span}{span}\(to, from, subject, msgText, cc, bcc){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} to -- A string containing 1 or multiple addresses seperated by a comma. \{[String]} from -- A string containing an address and an optional reply address, seperated by a comma. \{[String]} subject -- The subject of the bulk mail \{[String]} msgText -- The message text \{[String]} cc -- One or more addresses seperated by a comma \{[String]} bcc -- One or more addresses seperated by a comma {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>'; var success = plugins.mail.sendBulkMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]'); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendBulkMail-String_String_String_String_String_String_Attachment}{tr:id=name}{td}h6.sendBulkMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}sendBulkMail{span}{span}\(to, from, subject, msgText, cc, bcc, attachment){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} to -- A string containing 1 or multiple addresses seperated by a comma. \{[String]} from -- A string containing an address and an optional reply address, seperated by a comma. \{[String]} subject -- The subject of the bulk mail \{[String]} msgText -- The message text \{[String]} cc -- One or more addresses seperated by a comma \{[String]} bcc -- One or more addresses seperated by a comma \{[Attachment]} attachment -- A single attachment {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var attachment = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif')); var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>'; var success = plugins.mail.sendBulkMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected],[email protected]',attachment); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendBulkMail-String_String_String_String_String_String_Attachment_String}{tr:id=name}{td}h6.sendBulkMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}sendBulkMail{span}{span}\(to, from, subject, msgText, cc, bcc, attachment, smtpHost){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} to -- A string containing 1 or multiple addresses seperated by a comma. \{[String]} from -- A string containing an address and an optional reply address, seperated by a comma. \{[String]} subject -- The subject of the bulk mail \{[String]} msgText -- The message text \{[String]} cc -- One or more addresses seperated by a comma \{[String]} bcc -- One or more addresses seperated by a comma \{[Attachment]} attachment -- A single attachment \{[String]} smtpHost -- The smtp host {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var attachment = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif')); var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>'; var smtphost = 'myserver.com'; var success = plugins.mail.sendBulkMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]',attachment,smtphost); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendBulkMail-String_String_String_String_String_String_Attachment_StringArray}{tr:id=name}{td}h6.sendBulkMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}sendBulkMail{span}{span}\(to, from, subject, msgText, cc, bcc, attachment, overrideProperties){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} to -- A string containing 1 or multiple addresses seperated by a comma. \{[String]} from -- A string containing an address and an optional reply address, seperated by a comma. \{[String]} subject -- The subject of the bulk mail \{[String]} msgText -- The message text \{[String]} cc -- One or more addresses seperated by a comma \{[String]} bcc -- One or more addresses seperated by a comma \{[Attachment]} attachment -- A single attachment \{[String]\[]} overrideProperties -- An array of properties {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var attachment = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif')); var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>'; //it is possbile to set all kind of smtp properties var properties = new Array() properties[0] = 'mail.smtp.host=myserver.com' // properties specification can be found at:http://java.sun.com/products/javamail/javadocs/com/sun/mail/smtp/package-summary.html var success = plugins.mail.sendBulkMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]',attachment,properties); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendBulkMail-String_String_String_String_String_String_AttachmentArray}{tr:id=name}{td}h6.sendBulkMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}sendBulkMail{span}{span}\(to, from, subject, msgText, cc, bcc, attachments){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} to -- A string containing 1 or multiple addresses seperated by a comma. \{[String]} from -- A string containing an address and an optional reply address, seperated by a comma. \{[String]} subject -- The subject of the bulk mail \{[String]} msgText -- The message text \{[String]} cc -- One or more addresses seperated by a comma \{[String]} bcc -- One or more addresses seperated by a comma \{[Attachment]\[]} attachments -- The attachments {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var attachment1 = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif')); var attachment2 = plugins.mail.createTextAttachment('embedded','A text attachement'); var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>'; var success = plugins.mail.sendBulkMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected],[email protected]',[attachment1,attachment2]); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendBulkMail-String_String_String_String_String_String_AttachmentArray_String}{tr:id=name}{td}h6.sendBulkMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}sendBulkMail{span}{span}\(to, from, subject, msgText, cc, bcc, attachments, smtpHost){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} to -- A string containing 1 or multiple addresses seperated by a comma. \{[String]} from -- A string containing an address and an optional reply address, seperated by a comma. \{[String]} subject -- The subject of the bulk mail \{[String]} msgText -- The message text \{[String]} cc -- One or more addresses seperated by a comma \{[String]} bcc -- One or more addresses seperated by a comma \{[Attachment]\[]} attachments -- The attachments \{[String]} smtpHost -- The smtp host {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var attachment1 = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif')); var attachment2 = plugins.mail.createTextAttachment('embedded','A text attachement'); var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>'; var smtphost = 'myserver.com'; var success = plugins.mail.sendBulkMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]',[attachment1,attachement2],smtphost); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendBulkMail-String_String_String_String_String_String_AttachmentArray_StringArray}{tr:id=name}{td}h6.sendBulkMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}sendBulkMail{span}{span}\(to, from, subject, msgText, cc, bcc, attachments, overrideProperties){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} to -- A string containing 1 or multiple addresses seperated by a comma. \{[String]} from -- A string containing an address and an optional reply address, seperated by a comma. \{[String]} subject -- The subject of the bulk mail \{[String]} msgText -- The message text \{[String]} cc -- One or more addresses seperated by a comma \{[String]} bcc -- One or more addresses seperated by a comma \{[Attachment]\[]} attachments -- The attachments \{[String]\[]} overrideProperties -- An array of properties {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var attachment1 = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif')); var attachment2 = plugins.mail.createTextAttachment('embedded','A text attachement'); var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>'; //it is possbile to set all kind of smtp properties var properties = new Array() properties[0] = 'mail.smtp.host=myserver.com' // properties specification can be found at:http://java.sun.com/products/javamail/javadocs/com/sun/mail/smtp/package-summary.html var success = plugins.mail.sendBulkMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]',[attachment1,attachement2],properties); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send bulk mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendMail-String_String_String_String}{tr:id=name}{td}h6.sendMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}sendMail{span}{span}\(to, from, subject, msgText){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} to -- A string containing 1 or multiple addresses seperated by a comma. \{[String]} from -- A string containing an address and an optional reply address, seperated by a comma. \{[String]} subject -- The subject of the mail \{[String]} msgText -- The message text {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>'; var success = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>,[email protected]', 'subject', msgText); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendMail-String_String_String_String_String}{tr:id=name}{td}h6.sendMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}sendMail{span}{span}\(to, from, subject, msgText, cc){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} to -- A string containing 1 or multiple addresses seperated by a comma. \{[String]} from -- A string containing an address and an optional reply address, seperated by a comma. \{[String]} subject -- The subject of the mail \{[String]} msgText -- The message text \{[String]} cc -- One or more addresses seperated by a comma {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>'; var success = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,'[email protected],[email protected]'); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendMail-String_String_String_String_String_String}{tr:id=name}{td}h6.sendMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}sendMail{span}{span}\(to, from, subject, msgText, cc, bcc){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} to -- A string containing 1 or multiple addresses seperated by a comma. \{[String]} from -- A string containing an address and an optional reply address, seperated by a comma. \{[String]} subject -- The subject of the mail \{[String]} msgText -- The message text \{[String]} cc -- One or more addresses seperated by a comma \{[String]} bcc -- One or more addresses seperated by a comma {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>'; var success = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]'); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendMail-String_String_String_String_String_String_Attachment}{tr:id=name}{td}h6.sendMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}sendMail{span}{span}\(to, from, subject, msgText, cc, bcc, attachment){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} to -- A string containing 1 or multiple addresses seperated by a comma. \{[String]} from -- A string containing an address and an optional reply address, seperated by a comma. \{[String]} subject -- The subject of the mail \{[String]} msgText -- The message text \{[String]} cc -- One or more addresses seperated by a comma \{[String]} bcc -- One or more addresses seperated by a comma \{[Attachment]} attachment -- A single attachment {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var attachment = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif')); var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>'; var success = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected],[email protected]',attachment); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendMail-String_String_String_String_String_String_Attachment_String}{tr:id=name}{td}h6.sendMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}sendMail{span}{span}\(to, from, subject, msgText, cc, bcc, attachment, smtpHost){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} to -- A string containing 1 or multiple addresses seperated by a comma. \{[String]} from -- A string containing an address and an optional reply address, seperated by a comma. \{[String]} subject -- The subject of the mail \{[String]} msgText -- The message text \{[String]} cc -- One or more addresses seperated by a comma \{[String]} bcc -- One or more addresses seperated by a comma \{[Attachment]} attachment -- A single attachment \{[String]} smtpHost -- The smtp host {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var attachment = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif')); var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>'; var smtphost = 'myserver.com'; var success = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]',attachment,smtphost); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendMail-String_String_String_String_String_String_Attachment_StringArray}{tr:id=name}{td}h6.sendMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}sendMail{span}{span}\(to, from, subject, msgText, cc, bcc, attachment, overrideProperties){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} to -- A string containing 1 or multiple addresses seperated by a comma. \{[String]} from -- A string containing an address and an optional reply address, seperated by a comma. \{[String]} subject -- The subject of the mail \{[String]} msgText -- The message text \{[String]} cc -- One or more addresses seperated by a comma \{[String]} bcc -- One or more addresses seperated by a comma \{[Attachment]} attachment -- A single attachment \{[String]\[]} overrideProperties -- An array of properties {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var attachment = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif')); var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>'; //it is possbile to set all kind of smtp properties var properties = new Array() properties[0] = 'mail.smtp.host=myserver.com' // properties specification can be found at:http://java.sun.com/products/javamail/javadocs/com/sun/mail/smtp/package-summary.html var success = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]',attachment,properties); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendMail-String_String_String_String_String_String_AttachmentArray}{tr:id=name}{td}h6.sendMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}sendMail{span}{span}\(to, from, subject, msgText, cc, bcc, attachments){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} to -- A string containing 1 or multiple addresses seperated by a comma. \{[String]} from -- A string containing an address and an optional reply address, seperated by a comma. \{[String]} subject -- The subject of the mail \{[String]} msgText -- The message text \{[String]} cc -- One or more addresses seperated by a comma \{[String]} bcc -- One or more addresses seperated by a comma \{[Attachment]\[]} attachments -- The attachments {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var attachment1 = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif')); var attachment2 = plugins.mail.createTextAttachment('embedded','A text attachement'); var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>'; var success = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected],[email protected]',[attachment1,attachment2]); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendMail-String_String_String_String_String_String_AttachmentArray_String}{tr:id=name}{td}h6.sendMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}sendMail{span}{span}\(to, from, subject, msgText, cc, bcc, attachments, smtpHost){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} to -- A string containing 1 or multiple addresses seperated by a comma. \{[String]} from -- A string containing an address and an optional reply address, seperated by a comma. \{[String]} subject -- The subject of the mail \{[String]} msgText -- The message text \{[String]} cc -- One or more addresses seperated by a comma \{[String]} bcc -- One or more addresses seperated by a comma \{[Attachment]\[]} attachments -- The attachments \{[String]} smtpHost -- The smtp host {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var attachment1 = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif')); var attachment2 = plugins.mail.createTextAttachment('embedded','A text attachement'); var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>'; var smtphost = 'myserver.com'; var success = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]',[attachment1,attachement2],smtphost); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendMail-String_String_String_String_String_String_AttachmentArray_StringArray}{tr:id=name}{td}h6.sendMail{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[Boolean]{span}{span:style=font-weight: bold;}sendMail{span}{span}\(to, from, subject, msgText, cc, bcc, attachments, overrideProperties){span}{td}{tr}{tr:id=prs}{td}*Parameters*\\{div:class=sIndent}\{[String]} to -- A string containing 1 or multiple addresses seperated by a comma. \{[String]} from -- A string containing an address and an optional reply address, seperated by a comma. \{[String]} subject -- The subject of the mail \{[String]} msgText -- The message text \{[String]} cc -- One or more addresses seperated by a comma \{[String]} bcc -- One or more addresses seperated by a comma \{[Attachment]\[]} attachments -- The attachments \{[String]\[]} overrideProperties -- An array of properties {div}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[Boolean]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var attachment1 = plugins.mail.createBinaryAttachment('embedded',plugins.file.readFile('c:/temp/a_logo.gif')); var attachment2 = plugins.mail.createTextAttachment('embedded','A text attachement'); var msgText = 'plain msg<html>styled html msg<img src="%%embedded%%"></html>'; //it is possbile to set all kind of smtp properties var properties = new Array() properties[0] = 'mail.smtp.host=myserver.com' // properties specification can be found at:http://java.sun.com/products/javamail/javadocs/com/sun/mail/smtp/package-summary.html var success = plugins.mail.sendMail('[email protected],[email protected]', 'John Cobb <[email protected]>', 'subject', msgText,null,'[email protected]',[attachment1,attachement2],properties); if (!success) { plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK'); } {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table} |
Overview
Content Tools
Activity