Table Row (tr) |
---|
| Table Head (th) |
---|
| Method Details |
|
Table Body (tbody) |
---|
id | createBinaryAttachment |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
createBinaryAttachment |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Attachment |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| createBinaryAttachment |
Span |
---|
| (filename, binarydata, [mimeType]) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Creates a binary attachment object. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters filename binarydata [mimeType] |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
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=createTextAttachment|class=node}{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}Creates a text based attachment object.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\filename
textdata
\[mimeType\]
{td}{tr}{tr:id=ret}{td}*Returns*\\[Attachment]{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{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|class=node}{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}Get the exception that occurred in the last sendMail attempt (null if no exception occurred).{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\{td}{tr}{tr:id=ret}{td}*Returns*\\[String]{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{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|class=node}{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}Helper method, returns MailMessage object from binary or 7bits string.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\binaryblob/string
{td}{tr}{tr:id=ret}{td}*Returns*\\[MailMessage]{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}
var msg = plugins.mail.getMailMessage(myColumn);
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|class=node}{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}Helper method to only get the plain addresses.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\addressesString
{td}{tr}{tr:id=ret}{td}*Returns*\\[String]\[]{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{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|class=node}{tr:id=name}{td}h6.isValidEmailAddress{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Boolean]{span}{span:id=iets|style=float: left; font-weight: bold;}isValidEmailAddress{span}{span:id=iets|style=float: left;}\(email){span}{td}{tr}{tr:id=des}{td}Checks whether the given e\-mail address is valid or not.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\email
{td}{tr}{tr:id=ret}{td}*Returns*\\[Boolean]{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{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|class=node}{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}Receive mails from pop3 account.{td}{tr}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\userName
password
leaveMsgsOnServer
\[receiveMode\]
\[onlyreceiveMsgWithSentDate\]
\[overridePreferencePOP3Host/properties array\]
{td}{tr}{tr:id=ret}{td}*Returns*\\[MailMessage]\[]{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{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 Table Body (tbody) |
---|
id | createTextAttachment |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
createTextAttachment |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Attachment |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| createTextAttachment |
Span |
---|
| (filename, textdata, [mimeType]) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Creates a text based attachment object. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters filename textdata [mimeType] |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var attachment = plugins.mail.createTextAttachment('readme.html','<html>bla bla bla', 'text/html');
var success = plugins.mail.sendMail('[email protected]', 'John Cobb <[email protected]>', 'subject', 'msgText',null,null,attachment);
if (!success)
{
plugins.dialogs.showWarningDialog('Alert','Failed to send mail','OK');
}
|
|
|
|
|
Table Body (tbody) |
---|
id | getLastSendMailExceptionMsg |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getLastSendMailExceptionMsg |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getLastSendMailExceptionMsg |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Get the exception that occurred in the last sendMail attempt (null if no exception occurred). |
|
|
Table Body (tbody) |
---|
id | getMailMessage |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getMailMessage |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getMailMessage |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Helper method, returns MailMessage object from binary or 7bits string. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters binaryblob/string |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
var msg = plugins.mail.getMailMessage(myColumn);
if (msg != null) //if is null error occurred!
{
application.output(msg.getFromAddresses())
}
|
|
|
|
|
Table Body (tbody) |
---|
id | getPlainMailAddresses |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
getPlainMailAddresses |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| String[] |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| getPlainMailAddresses |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Helper method to only get the plain addresses. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters addressesString |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Returns String[] |
|
|
Table Body (tbody) |
---|
id | isValidEmailAddress |
---|
class | node |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
isValidEmailAddress |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| isValidEmailAddress |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Checks whether the given e-mail address is valid or not. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters email |
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
receiveMail |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| receiveMail |
Span |
---|
| (userName, password, leaveMsgsOnServer, [receiveMode], [onlyreceiveMsgWithSentDate], [overridePreferencePOP3Host/properties array]) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Receive mails from pop3 account. |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters userName password leaveMsgsOnServer [receiveMode] [onlyreceiveMsgWithSentDate] [overridePreferencePOP3Host/properties array] |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
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 , 0 , null, properties);
{code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=sendMail|class=node}{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[,to2,toN\], \[from[,reply\], subject, msgText, \[cc,cc2,ccN\], \[bcc,bcc2,bccN\], \[attachment/attachments array\], \[overridePreferenceSMTPHost/properties array\]){span}{td}{tr}{tr:id=des}{td}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}{tr:id=snc}{td}*Since*\\ Replace with version info{td}{tr}{tr:id=prs}{td}*Parameters*\\\[to\[,to2,toN\]
\[from\[,reply\]
subject
msgText
\[cc,cc2,ccN\]
\[bcc,bcc2,bccN\]
\[attachment/attachments array\]
\[overridePreferenceSMTPHost/properties array\]
{td}{tr}{tr:id=ret}{td}*Returns*\\[Boolean]{td}{tr}{tr:id=see}{td}*Also see*\\{div:class=sIndent}{div}{td}{tr}{tr:id=link}{td}*External links*\\{div:class=sIndent}{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript}', '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);
|
|
|
|
|
Table Body (tbody) |
---|
| Table Row (tr) |
---|
| Table Cell (td) |
---|
Span |
---|
style | float: left; margin-right: 5px; |
---|
| Boolean |
Span |
---|
style | float: left; font-weight: bold; |
---|
id | iets |
---|
| sendMail |
Span |
---|
| ([to[,to2,toN], [from[,reply], subject, msgText, [cc,cc2,ccN], [bcc,bcc2,bccN], [attachment/attachments array], [overridePreferenceSMTPHost/properties array]) |
|
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Send a mail, if you make the msgText start with <html> the message will be sent in html (and you can use all html formatting). |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Parameters [to[,to2,toN] [from[,reply] subject msgText [cc,cc2,ccN] [bcc,bcc2,bccN] [attachment/attachments array] [overridePreferenceSMTPHost/properties array] |
|
Table Row (tr) |
---|
| Table Cell (td) |
---|
Sample
Div |
---|
| Code Block |
---|
|
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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table} |