Child pages
  • MailMessage

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
{hidden} DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING. THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden} {sub-section:description|text=}{sub-section}\\ {table:id=|class=servoy sSummary}{colgroup}{column:padding=0px|width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[Attachment]\[]{td}{td}[#getAttachments]\() Returns an array of Attachment instances corresponding to the attachments of this message.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getCCAddresses]\() Returns a String with all addresses present in the CC field of this message.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getFromAddresses]\() Returns a String with all addresses present in the From field of this message.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getHeaders]\() Returns a String with all headers of this message.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getHtmlMsg]\() Returns a String with the HTML content of this message.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getPlainMsg]\() Returns a String with the plain content of this message.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getRecipientAddresses]\() Returns a String with all addresses in the To field of this message.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getReplyAddresses]\() Returns a String with all addresses in the Reply\-To field of this message.{td}{tr}{tbody}{tbody}{tr}{td}[Date]{td}{td}[#getSentDate]\() Returns a Date instance corresponding to the moment when this message was sent.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#getSubject]\() Returns a String with the subject of this message.{td}{tr}{tbody}{table}\\ {table:id=function|class=servoy sDetail}{colgroup}{column:padding=0px|width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=getAttachments|class=node}{tr:id=name}{td}h6.getAttachments{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Attachment]\[]{span}{span:id=iets|style=float: left; font-weight: bold;}getAttachments{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getAttachments_des|text=|trigger=button}{sub-section}{sub-section:getAttachments_des|trigger=none|class=sIndent}Returns an array of Attachment instances corresponding to the attachments of this message.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getAttachments_snc|text=|trigger=button}{sub-section}{sub-section:getAttachments_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getAttachments_prs|text=|trigger=button}{sub-section}{sub-section:getAttachments_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getAttachments_ret|text=|trigger=button}{sub-section}{sub-section:getAttachments_ret|trigger=none|class=sIndent}[Attachment]\[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getAttachments_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getAttachments_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getAttachments_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getAttachments_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getAttachments_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getAttachments_sam|trigger=none}{code:language=javascript} var msgs = plugins.mail.receiveMail(username, password, true, 0, null, properties); if (msgs != null) { for (var i=0; i < msgs.length; i++) { var msg = msgs[i]; var str = ''; str += 'From: ' + msg.getFromAddresses() + '\n'; str += 'To: ' + msg.getRecipientAddresses
Wiki Markup
Div
styledisplay: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
iddescription



HTML Table
id
classservoy sSummary
Colgroup Tag
Col
width80px
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Summary
Table Row (tr)
Table Cell (td)
Attachment[]
Table Cell (td)
getAttachments()
Returns an array of Attachment instances corresponding to the attachments of this message.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
getCCAddresses()
Returns a String with all addresses present in the CC field of this message.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
getFromAddresses()
Returns a String with all addresses present in the From field of this message.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
getHeaders()
Returns a String with all headers of this message.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
getHtmlMsg()
Returns a String with the HTML content of this message.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
getPlainMsg()
Returns a String with the plain content of this message.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
getRecipientAddresses()
Returns a String with all addresses in the To field of this message.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
getReplyAddresses()
Returns a String with all addresses in the Reply-To field of this message.
Table Row (tr)
Table Cell (td)
Date
Table Cell (td)
getSentDate()
Returns a Date instance corresponding to the moment when this message was sent.
Table Row (tr)
Table Cell (td)
String
Table Cell (td)
getSubject()
Returns a String with the subject of this message.



HTML Table
idfunction
classservoy sDetail
Colgroup Tag
Col
colspan2
width100%
Col
Table Head (thead)
Table Row (tr)
styleheight: 30px;
Table Head (th)
colspan2
Method Details
Table Body (tbody)
idgetAttachments
Table Row (tr)
idname
Table Cell (td)

getAttachments

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Attachment[]
Span
stylefont-weight: bold;
getAttachments
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns an array of Attachment instances corresponding to the attachments of this message.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Attachment[]
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var msgs = plugins.mail.receiveMail(username, password, true, 0, null, properties);
if (msgs != null)
{
	for (var i=0; i < msgs.length; i++)
	{
		var msg = msgs[i];
		var str = '';
		str += 'From: ' + msg.getFromAddresses() + '\n';
		str += 'To: ' + msg.getRecipientAddresses() + '\n';
		str += 'CC: ' + msg.getCCAddresses() + '\n';
		str += 'Reply to: ' + msg.getReplyAddresses() + '\n';
		str += 'Received on: ' + msg.getReceivedDate() + '\n';
		str += 'Sent on: ' + msg.getSentDate() + '\n\n';
		str += 'Subject: ' + msg.getSubject() + '\n\n';
		str += 'Plain message: ' + msg.getPlainMsg() + '\n\n';
		str += 'HTML message: ' + msg.getHtmlMsg() + '\n\n';
		str += 'Headers: ' + msg.getHeaders() + '\n\n';
		var attachments = msg.getAttachments();
		if (attachments != null) {
			str += 'Number of attachments: ' + attachments.length + '\n\n';
			for (var j=0; j < attachments.length; j++)
			{
				var attachment = attachments[j];
				str += 'Attachment ' + j + '\n';
				str += '	Name: ' + attachment.getName() + '\n';
				str += '
CC
	Size: ' + 
msg
attachment.
getCCAddresses
getData().length + '\n\n';
			
str += 'Reply to:
}
		}
		plugins.file.writeTXTFile('msg' + 
msg.getReplyAddresses()
i + '
\n'
.txt', str);
		
str
application.output('Message ' +
=
 
'Received
i 
on:
+ ' 
+ msg.getReceivedDate() + '\n'
retrieved.');
	
str
}
+=
}
'Sent on: ' + msg.getSentDate() + '\n\n'; str += 'Subject: ' + msg.getSubject() + '\n\n'; str += 'Plain message: ' + msg.getPlainMsg() + '\n\n'; str += 'HTML message: ' + msg.getHtmlMsg() + '\n\n'; str += 'Headers: ' + msg.getHeaders() + '\n\n'; var attachments = msg.getAttachments(); if (attachments != null) { str += 'Number of attachments: ' + attachments.length + '\n\n'; for (var j=0; j < attachments.length; j++) { var attachment = attachments[j];
else
{
	application.output("Failed to retrieve messages.");
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetCCAddresses
Table Row (tr)
idname
Table Cell (td)

getCCAddresses

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getCCAddresses
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns a String with all addresses present in the CC field of this message.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var msgs = plugins.mail.receiveMail(username, password, true, 0, null, properties);
if (msgs != null)
{
	for (var i=0; i < msgs.length; i++)
	{
		var msg = msgs[i];
		var str = '';
		str += '
Attachment
From: ' + 
j
msg.getFromAddresses() + '\n';
		str += '
Name
To: ' + 
attachment
msg.
getName
getRecipientAddresses() + '\n';
		str += '
Size
CC: ' + 
attachment
msg.
getData
getCCAddresses()
.length
 + '\n
\n
';
		
} } plugins.file.writeTXTFile('msg
str += 'Reply to: ' + 
i
msg.getReplyAddresses() + '
.txt', str)
\n';
		
application.output('Message
str += 'Received on: ' + 
i
msg.getReceivedDate() + '
retrieved.
\n'
)
;
} } else { application.output("Failed to retrieve messages."); } {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getCCAddresses|class=node}{tr:id=name}{td}h6.getCCAddresses{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getCCAddresses{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getCCAddresses_des|text=|trigger=button}{sub-section}{sub-section:getCCAddresses_des|trigger=none|class=sIndent}Returns a String with all addresses present in the CC field of this message.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getCCAddresses_snc|text=|trigger=button}{sub-section}{sub-section:getCCAddresses_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getCCAddresses_prs|text=|trigger=button}{sub-section}{sub-section:getCCAddresses_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getCCAddresses_ret|text=|trigger=button}{sub-section}{sub-section:getCCAddresses_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getCCAddresses_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getCCAddresses_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getCCAddresses_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getCCAddresses_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getCCAddresses_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getCCAddresses_sam|trigger=none}{code:language=javascript} var msgs = plugins.mail.receiveMail(username, password, true, 0, null, properties); if (msgs != null) { for (var i=0; i < msgs.length; i++) { var msg = msgs
		str += 'Sent on: ' + msg.getSentDate() + '\n\n';
		str += 'Subject: ' + msg.getSubject() + '\n\n';
		str += 'Plain message: ' + msg.getPlainMsg() + '\n\n';
		str += 'HTML message: ' + msg.getHtmlMsg() + '\n\n';
		str += 'Headers: ' + msg.getHeaders() + '\n\n';
		var attachments = msg.getAttachments();
		if (attachments != null) {
			str += 'Number of attachments: ' + attachments.length + '\n\n';
			for (var j=0; j < attachments.length; j++)
			{
				var attachment = attachments[j];
				str += 'Attachment ' + j + '\n';
				str += '	Name: ' + attachment.getName() + '\n';
				str += '	Size: ' + attachment.getData().length + '\n\n';
			}
		}
		plugins.file.writeTXTFile('msg' + i + '.txt', str);
		application.output('Message ' + i + ' retrieved.');
	}
}
else
{
	application.output("Failed to retrieve messages.");
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetFromAddresses
Table Row (tr)
idname
Table Cell (td)

getFromAddresses

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getFromAddresses
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns a String with all addresses present in the From field of this message.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var msgs = plugins.mail.receiveMail(username, password, true, 0, null, properties);
if (msgs != null)
{
	for (var i=0; i < msgs.length; i++)
	{
		var msg = msgs[i];
		var str = '';
		str += 'From: ' + msg.getFromAddresses() + '\n';
		str += 'To: ' + msg.getRecipientAddresses() + '\n';
		str += 'CC: ' + msg.getCCAddresses() + '\n';
		str += 'Reply to: ' + msg.getReplyAddresses() + '\n';
		str += 'Received on: ' + msg.getReceivedDate() + '\n';
		str += 'Sent on: ' + msg.getSentDate() + '\n\n';
		str += 'Subject: ' + msg.getSubject() + '\n\n';
		str += 'Plain message: ' + msg.getPlainMsg() + '\n\n';
		str += 'HTML message: ' + msg.getHtmlMsg() + '\n\n';
		str += 'Headers: ' + msg.getHeaders() + '\n\n';
		var attachments = msg.getAttachments();
		if (attachments != null) {
			str += 'Number of attachments: ' + attachments.length + '\n\n';
			for (var j=0; j < attachments.length; j++)
			{
				var attachment = attachments[j];
				str += 'Attachment ' + j + '\n';
				str += '	Name: ' + attachment.getName() + '\n';
				str += '	Size: ' + attachment.getData().length + '\n\n';
			}
		}
		plugins.file.writeTXTFile('msg' + i + '.txt', str);
		application.output('Message ' + i + ' retrieved.');
	}
}
else
{
	application.output("Failed to retrieve messages.");
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getFromAddresses|class=node}{tr:id=name}{td}h6.getFromAddresses{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getFromAddresses{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getFromAddresses_des|text=|trigger=button}{sub-section}{sub-section:getFromAddresses_des|trigger=none|class=sIndent}Returns a String with all addresses present in the From field of this message.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getFromAddresses_snc|text=|trigger=button}{sub-section}{sub-section:getFromAddresses_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getFromAddresses_prs|text=|trigger=button}{sub-section}{sub-section:getFromAddresses_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getFromAddresses_ret|text=|trigger=button}{sub-section}{sub-section:getFromAddresses_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getFromAddresses_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getFromAddresses_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getFromAddresses_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getFromAddresses_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getFromAddresses_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getFromAddresses_sam|trigger=none}{code:language=javascript} var msgs = plugins.mail.receiveMail(username, password, true, 0, null, properties); if (msgs != null) { for (var i=0; i < msgs.length; i++) { var msg = msgs[i]; var str = ''; str += 'From: ' + msg.getFromAddresses()
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetHeaders
Table Row (tr)
idname
Table Cell (td)

getHeaders

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getHeaders
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns a String with all headers of this message.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var msgs = plugins.mail.receiveMail(username, password, true, 0, null, properties);
if (msgs != null)
{
	for (var i=0; i < msgs.length; i++)
	{
		var msg = msgs[i];
		var str = '';
		str += 'From: ' + msg.getFromAddresses() + '\n';
		str += 'To: ' + msg.getRecipientAddresses() + '\n';
		str += 'CC: ' + msg.getCCAddresses() + '\n';
		str += 'Reply to: ' + msg.getReplyAddresses() + '\n';
		str += 'Received on: ' + msg.getReceivedDate() + '\n';
		str += 'Sent on: ' + msg.getSentDate() + '\n\n';
		str += 'Subject: ' + msg.getSubject() + '\n\n';
		str += 'Plain message: ' + msg.getPlainMsg() + '\n\n';
		str += 'HTML message: ' + msg.getHtmlMsg() + '\n\n';
		str += 'Headers: ' + msg.getHeaders() + '\n\n';
		var attachments = msg.getAttachments();
		if (attachments != null) {
			str += 'Number of attachments: ' + attachments.length + '\n\n';
			for (var j=0; j < attachments.length; j++)
			{
				var attachment = attachments[j];
				str += 'Attachment ' + j + '\n';
				str += '
To
	Name: ' + 
msg
attachment.
getRecipientAddresses
getName() + '\n';
				str += '
CC
	Size: ' + 
msg
attachment.
getCCAddresses
getData().length + '\n\n';
		
str += 'Reply to:
	}
		}
		plugins.file.writeTXTFile('msg' + 
msg.getReplyAddresses()
i + '
\n
.txt'
;
, 
str
+= 'Received on: ' + msg.getReceivedDate(
)
+ '\n'
;
		
str += 'Sent on:
application.output('Message ' + 
msg.getSentDate()
i + '
\n\n'
 retrieved.');
	
str
}
+= 'Subject: ' + msg.getSubject() + '\n\n'; str += 'Plain message: ' + msg.getPlainMsg() + '\n\n'; str += 'HTML message: ' + msg.getHtmlMsg() + '\n\n'; str += 'Headers: ' + msg.getHeaders() + '\n\n'; var attachments = msg.getAttachments(); if (attachments != null) { str += 'Number of attachments: ' + attachments.length + '\n\n'; for (var j=0; j < attachments.length; j++) { var attachment = attachments[j];
}
else
{
	application.output("Failed to retrieve messages.");
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetHtmlMsg
Table Row (tr)
idname
Table Cell (td)

getHtmlMsg

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getHtmlMsg
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns a String with the HTML content of this message.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var msgs = plugins.mail.receiveMail(username, password, true, 0, null, properties);
if (msgs != null)
{
	for (var i=0; i < msgs.length; i++)
	{
		var msg = msgs[i];
		var str = '';
		str += '
Attachment
From: ' + 
j
msg.getFromAddresses() + '\n';
		
str += '
Name
To: ' + 
attachment
msg.
getName
getRecipientAddresses() + '\n';
		
str += '
Size
CC: ' + 
attachment
msg.
getData
getCCAddresses()
.length
 + '
\n
\n';
		
} } plugins.file.writeTXTFile('msg
str += 'Reply to: ' + 
i
msg.getReplyAddresses() + '
.txt', str)
\n';
		
application.output('Message
str += 'Received on: ' + 
i
msg.getReceivedDate() + '
retrieved.'); } } else { application.output("Failed to retrieve messages."); } {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getHeaders|class=node}{tr:id=name}{td}h6.getHeaders{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getHeaders{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getHeaders_des|text=|trigger=button}{sub-section}{sub-section:getHeaders_des|trigger=none|class=sIndent}Returns a String with all headers of this message.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getHeaders_snc|text=|trigger=button}{sub-section}{sub-section:getHeaders_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getHeaders_prs|text=|trigger=button}{sub-section}{sub-section:getHeaders_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getHeaders_ret|text=|trigger=button}{sub-section}{sub-section:getHeaders_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getHeaders_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getHeaders_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getHeaders_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getHeaders_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getHeaders_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getHeaders_sam|trigger=none}{code:language=javascript} var msgs = plugins.mail.receiveMail(username, password, true, 0, null, properties); if (msgs != null) { for (var i=0; i < msgs.length; i++) { var msg = msgs[i]; var str = '
\n';
		str += 'Sent on: ' + msg.getSentDate() + '\n\n';
		str += 'Subject: ' + msg.getSubject() + '\n\n';
		str += 'Plain message: ' + msg.getPlainMsg() + '\n\n';
		str += 'HTML message: ' + msg.getHtmlMsg() + '\n\n';
		str += 'Headers: ' + msg.getHeaders() + '\n\n';
		var attachments = msg.getAttachments();
		if (attachments != null) {
			str += 'Number of attachments: ' + attachments.length + '\n\n';
			for (var j=0; j < attachments.length; j++)
			{
				var attachment = attachments[j];
				str += 'Attachment ' + j + '\n';
				str += '	Name: ' + attachment.getName() + '\n';
				str += '	Size: ' + attachment.getData().length + '\n\n';
			}
		}
		plugins.file.writeTXTFile('msg' + i + '.txt', str);
		application.output('Message ' + i + ' retrieved.');
	}
}
else
{
	application.output("Failed to retrieve messages.");
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetPlainMsg
Table Row (tr)
idname
Table Cell (td)

getPlainMsg

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getPlainMsg
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns a String with the plain content of this message.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var msgs = plugins.mail.receiveMail(username, password, true, 0, null, properties);
if (msgs != null)
{
	for (var i=0; i < msgs.length; i++)
	{
		var msg = msgs[i];
		var str = '';
		str += 'From: ' + msg.getFromAddresses() + '\n';
		str += 'To: ' + msg.getRecipientAddresses() + '\n';
		str += 'CC: ' + msg.getCCAddresses() + '\n';
		str += '
From
Reply to: ' + msg.
getFromAddresses
getReplyAddresses() + '\n';
		str += '
To
Received on: ' + msg.
getRecipientAddresses
getReceivedDate() + '\n';
		str += '
CC
Sent on: ' + msg.
getCCAddresses
getSentDate() + '\n\n';
		str += '
Reply to: ' + msg.getReplyAddresses() + '\n'; str += 'Received on: ' + msg.getReceivedDate() + '\n'; str += 'Sent on: ' + msg.getSentDate() + '\n\n'; str += 'Subject
Subject: ' + msg.getSubject() + '\n\n';
		str += 'Plain message: ' + msg.getPlainMsg() + '\n\n';
		str += 'HTML message: ' + msg.getHtmlMsg() + '\n\n';
		str += 'Headers: ' + msg.getHeaders() + '\n\n';
		var attachments = msg.getAttachments();
		if (attachments != null) {
			str += 'Number of attachments: ' + attachments.length + '\n\n';
			for (var j=0; j < attachments.length; j++)
			{
				var attachment = attachments[j];
				str += 'Attachment ' + j + '\n';
				str += '	Name: ' + attachment.getName() + '\n';
				str += '	Size: ' + attachment.getData().length + '\n\n';
			}
		}
		plugins.file.writeTXTFile('msg' + i + '.txt', str);
		application.output('Message ' + i + ' retrieved.');
	}
}
else
{
	application.output("Failed to retrieve messages.");
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getHtmlMsg|class=node}{tr:id=name}{td}h6.getHtmlMsg{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getHtmlMsg{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getHtmlMsg_des|text=|trigger=button}{sub-section}{sub-section:getHtmlMsg_des|trigger=none|class=sIndent}Returns a String with the HTML content of this message.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getHtmlMsg_snc|text=|trigger=button}{sub-section}{sub-section:getHtmlMsg_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getHtmlMsg_prs|text=|trigger=button}{sub-section}{sub-section:getHtmlMsg_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getHtmlMsg_ret|text=|trigger=button}{sub-section}{sub-section:getHtmlMsg_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getHtmlMsg_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getHtmlMsg_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getHtmlMsg_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getHtmlMsg_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getHtmlMsg_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getHtmlMsg_sam|trigger=none}{code:language=javascript} var msgs = plugins.mail.receiveMail(username, password, true, 0, null, properties); if (msgs != null) { for (var i=0; i < msgs.length; i++) { var msg = msgs[i]; var str = ''; str += 'From: ' + msg.getFromAddresses()
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetRecipientAddresses
Table Row (tr)
idname
Table Cell (td)

getRecipientAddresses

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getRecipientAddresses
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns a String with all addresses in the To field of this message.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var msgs = plugins.mail.receiveMail(username, password, true, 0, null, properties);
if (msgs != null)
{
	for (var i=0; i < msgs.length; i++)
	{
		var msg = msgs[i];
		var str = '';
		str += 'From: ' + msg.getFromAddresses() + '\n';
		str += 'To: ' + msg.getRecipientAddresses() + '\n';
		str += 'CC: ' + msg.getCCAddresses() + '\n';
		str += 'Reply to: ' + msg.getReplyAddresses() + '\n';
		str += 'Received on: ' + msg.getReceivedDate() + '\n';
		str += 'Sent on: ' + msg.getSentDate() + '\n\n';
		str += 'Subject: ' + msg.getSubject() + '\n\n';
		str += 'Plain message: ' + msg.getPlainMsg() + '\n\n';
		str += 'HTML message: ' + msg.getHtmlMsg() + '\n\n';
		str += 'Headers: ' + msg.getHeaders() + '\n\n';
		var attachments = msg.getAttachments();
		if (attachments != null) {
			str += 'Number of attachments: ' + attachments.length + '\n\n';
			for (var j=0; j < attachments.length; j++)
			{
				var attachment = attachments[j];
				str += 'Attachment ' + j + '\n';
				str += '
To
	Name: ' + 
msg
attachment.
getRecipientAddresses
getName() + '\n';
				str += '
CC
	Size: ' + 
msg
attachment.
getCCAddresses
getData().length + '\n\n';
			
str += 'Reply to:
}
		}
		plugins.file.writeTXTFile('msg' + 
msg.getReplyAddresses()
i + '
\n'
.txt', str);
		
str += 'Received on:
application.output('Message ' + 
msg.getReceivedDate()
i + '
\n
 retrieved.');
	
str
}
+=
}
'Sent on: ' + msg.getSentDate() + '\n\n'; str += 'Subject: ' + msg.getSubject() + '\n\n'; str += 'Plain message: ' + msg.getPlainMsg() + '\n\n'; str += 'HTML message: ' + msg.getHtmlMsg() + '\n\n'; str += 'Headers: ' + msg.getHeaders() + '\n\n'; var attachments = msg.getAttachments(); if (attachments
else
{
	application.output("Failed to retrieve messages.");
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetReplyAddresses
Table Row (tr)
idname
Table Cell (td)

getReplyAddresses

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getReplyAddresses
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns a String with all addresses in the Reply-To field of this message.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var msgs = plugins.mail.receiveMail(username, password, true, 0, null, properties);
if (msgs != null)
{
	
str += 'Number of attachments: ' + attachments.length + '\n\n'; for (var j=0; j < attachments
for (var i=0; i < msgs.length; 
j
i++)
	
{
		
var 
attachment
msg = 
attachments
msgs[
j
i];
		var str = '';
		str += '
Attachment
From: ' + 
j
msg.getFromAddresses() + '\n';
		
str += '
Name
To: ' + 
attachment
msg.
getName
getRecipientAddresses() + '\n';
		str += '
Size
CC: ' + 
attachment
msg.
getData
getCCAddresses()
.length
 + '\n
\n
';
		
} } plugins.file.writeTXTFile('msg
str += 'Reply to: ' + 
i
msg.getReplyAddresses() + '
.txt', str)
\n';
		
application.output('Message
str += 'Received on: ' + 
i
msg.getReceivedDate() + '
retrieved.
\n'
)
;
} } else { application.output("Failed to retrieve messages."); } {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getPlainMsg|class=node}{tr:id=name}{td}h6.getPlainMsg{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getPlainMsg{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getPlainMsg_des|text=|trigger=button}{sub-section}{sub-section:getPlainMsg_des|trigger=none|class=sIndent}Returns a String with the plain content of this message.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getPlainMsg_snc|text=|trigger=button}{sub-section}{sub-section:getPlainMsg_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getPlainMsg_prs|text=|trigger=button}{sub-section}{sub-section:getPlainMsg_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getPlainMsg_ret|text=|trigger=button}{sub-section}{sub-section:getPlainMsg_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getPlainMsg_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getPlainMsg_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getPlainMsg_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getPlainMsg_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getPlainMsg_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getPlainMsg_sam|trigger=none}{code:language=javascript} var msgs = plugins.mail.receiveMail(username, password, true, 0, null, properties); if (msgs != null) { for (var i=0; i < msgs.length; i++) { var msg = msgs[i]; var str = ''; str += 'From: ' + msg.getFromAddresses() + '\n'; str += 'To: ' + msg.getRecipientAddresses() + '\n'; str += 'CC: ' + msg.getCCAddresses() + '\n'; str += 'Reply to: ' + msg.getReplyAddresses() + '\n'; str += 'Received on: ' + msg.getReceivedDate() + '\n'; str += 'Sent on: ' + msg.getSentDate() + '\n\n'; str += 'Subject: ' + msg.getSubject() + '\n\n'; str += 'Plain message: ' + msg.getPlainMsg() + '\n\n'; str += 'HTML message: ' + msg.getHtmlMsg() + '\n\n'; str += 'Headers: ' + msg.getHeaders() + '\n\n'; var attachments = msg.getAttachments(); if (attachments != null) { str += 'Number of attachments: ' + attachments.length + '\n\n'; for (var j=0; j < attachments.length; j++) { var attachment = attachments[j]; str += 'Attachment ' + j + '\n'; str += ' Name: ' + attachment.getName() + '\n'; str += ' Size: ' + attachment.getData().length + '\n\n'; } } plugins.file.writeTXTFile('msg' + i + '.txt', str); application.output('Message ' + i + ' retrieved.'); } } else { application.output("Failed to retrieve messages."); } {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getRecipientAddresses|class=node}{tr:id=name}{td}h6.getRecipientAddresses{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getRecipientAddresses{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getRecipientAddresses_des|text=|trigger=button}{sub-section}{sub-section:getRecipientAddresses_des|trigger=none|class=sIndent}Returns a String with all addresses in the To field of this message.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getRecipientAddresses_snc|text=|trigger=button}{sub-section}{sub-section:getRecipientAddresses_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getRecipientAddresses_prs|text=|trigger=button}{sub-section}{sub-section:getRecipientAddresses_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getRecipientAddresses_ret|text=|trigger=button}{sub-section}{sub-section:getRecipientAddresses_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getRecipientAddresses_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRecipientAddresses_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getRecipientAddresses_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRecipientAddresses_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getRecipientAddresses_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getRecipientAddresses_sam|trigger=none}{code:language=javascript} var msgs = plugins.mail.receiveMail(username, password, true, 0, null, properties); if (msgs != null) { for (var i=0; i < msgs.length; i++) { var msg = msgs[i]; var str = ''; str += 'From: ' + msg.getFromAddresses() + '\n'; str += 'To: ' + msg.getRecipientAddresses() + '\n'; str += 'CC: ' + msg.getCCAddresses() + '\n'; str += 'Reply to: ' + msg.getReplyAddresses() + '\n'; str += 'Received on: ' + msg.getReceivedDate() + '\n'; str += 'Sent on: ' + msg.getSentDate() + '\n\n'; str += 'Subject: ' + msg.getSubject() + '\n\n'; str += 'Plain message: ' + msg.getPlainMsg() + '\n\n'; str += 'HTML message: ' + msg.getHtmlMsg() + '\n\n'; str += 'Headers: ' + msg.getHeaders() + '\n\n'; var attachments = msg.getAttachments(); if (attachments != null) { str += 'Number of attachments: ' + attachments.length + '\n\n'; for (var j=0; j < attachments.length; j++) { var attachment = attachments[j]; str += 'Attachment ' + j + '\n'; str += ' Name: ' + attachment.getName() + '\n'; str += ' Size: ' + attachment.getData().length + '\n\n'; } } plugins.file.writeTXTFile('msg' + i + '.txt', str); application.output('Message ' + i + ' retrieved.'); } } else { application.output("Failed to retrieve messages."); } {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getReplyAddresses|class=node}{tr:id=name}{td}h6.getReplyAddresses{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getReplyAddresses{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getReplyAddresses_des|text=|trigger=button}{sub-section}{sub-section:getReplyAddresses_des|trigger=none|class=sIndent}Returns a String with all addresses in the Reply\-To field of this message.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getReplyAddresses_snc|text=|trigger=button}{sub-section}{sub-section:getReplyAddresses_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getReplyAddresses_prs|text=|trigger=button}{sub-section}{sub-section:getReplyAddresses_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getReplyAddresses_ret|text=|trigger=button}{sub-section}{sub-section:getReplyAddresses_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getReplyAddresses_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getReplyAddresses_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getReplyAddresses_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getReplyAddresses_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getReplyAddresses_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getReplyAddresses_sam|trigger=none}{code:language=javascript} var msgs = plugins.mail.receiveMail(username, password, true, 0, null, properties); if (msgs != null) { for (var i=0; i < msgs.length; i++) { var msg = msgs[i]; var str = ''; str += 'From: ' + msg.getFromAddresses() + '\n'; str += 'To: ' + msg.getRecipientAddresses() + '\n'; str += 'CC: ' + msg.getCCAddresses() + '\n'; str += 'Reply to: ' + msg.getReplyAddresses() + '\n'; str += 'Received on: ' + msg.getReceivedDate() + '\n'; str += 'Sent on: ' + msg.getSentDate() + '\n\n'; str += 'Subject: ' + msg.getSubject() + '\n\n'; str += 'Plain message: ' + msg.getPlainMsg() + '\n\n'; str += 'HTML message: ' + msg.getHtmlMsg() + '\n\n'; str += 'Headers: ' + msg.getHeaders() + '\n\n'; var attachments = msg.getAttachments(); if (attachments != null) { str += 'Number of attachments: ' + attachments.length + '\n\n'; for (var j=0; j < attachments.length; j++) { var attachment = attachments[j]; str += 'Attachment ' + j + '\n'; str += ' Name: ' + attachment.getName() + '\n'; str += ' Size: ' + attachment.getData().length + '\n\n'; } } plugins.file.writeTXTFile('msg' + i + '.txt', str); application.output('Message ' + i + ' retrieved.'); } } else { application.output("Failed to retrieve messages."); } {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getSentDate|class=node}{tr:id=name}{td}h6.getSentDate{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[Date]{span}{span:id=iets|style=float: left; font-weight: bold;}getSentDate{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getSentDate_des|text=|trigger=button}{sub-section}{sub-section:getSentDate_des|trigger=none|class=sIndent}Returns a Date instance corresponding to the moment when this message was sent.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getSentDate_snc|text=|trigger=button}{sub-section}{sub-section:getSentDate_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getSentDate_prs|text=|trigger=button}{sub-section}{sub-section:getSentDate_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getSentDate_ret|text=|trigger=button}{sub-section}{sub-section:getSentDate_ret|trigger=none|class=sIndent}[Date]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getSentDate_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getSentDate_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getSentDate_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getSentDate_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getSentDate_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getSentDate_sam|trigger=none}{code:language=javascript} var msgs = plugins.mail.receiveMail(username, password, true, 0, null, properties); if (msgs != null) { for (var i=0; i < msgs.length; i++) { var msg = msgs[i]; var str = ''; str += 'From: ' + msg.getFromAddresses() + '\n'; str += 'To: ' + msg.getRecipientAddresses() + '\n'; str += 'CC: ' + msg.getCCAddresses() + '\n'; str += 'Reply to: ' + msg.getReplyAddresses() + '\n'; str += 'Received on: ' + msg.getReceivedDate() + '\n'; str += 'Sent on: ' + msg.getSentDate() + '\n\n'; str += 'Subject: ' + msg.getSubject() + '\n\n'; str += 'Plain message: ' + msg.getPlainMsg() + '\n\n'; str += 'HTML message: ' + msg.getHtmlMsg() + '\n\n'; str += 'Headers: ' + msg.getHeaders() + '\n\n'; var attachments = msg.getAttachments(); if (attachments != null) { str += 'Number of attachments: ' + attachments.length + '\n\n'; for (var j=0; j < attachments.length; j++) { var attachment = attachments[j]; str += 'Attachment ' + j + '\n'; str += ' Name: ' + attachment.getName() + '\n'; str += ' Size: ' + attachment.getData().length + '\n\n'; } } plugins.file.writeTXTFile('msg' + i + '.txt', str); application.output('Message ' + i + ' retrieved.'); } } else { application.output("Failed to retrieve messages."); } {code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getSubject|class=node}{tr:id=name}{td}h6.getSubject{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getSubject{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:getSubject_des|text=|trigger=button}{sub-section}{sub-section:getSubject_des|trigger=none|class=sIndent}Returns a String with the subject of this message.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getSubject_snc|text=|trigger=button}{sub-section}{sub-section:getSubject_snc|trigger=none|class=sIndent} Replace with version info{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:getSubject_prs|text=|trigger=button}{sub-section}{sub-section:getSubject_prs|trigger=none|class=sIndent}{sub-section}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:getSubject_ret|text=|trigger=button}{sub-section}{sub-section:getSubject_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:getSubject_see|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getSubject_see|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:getSubject_link|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getSubject_link|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:getSubject_sam|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:getSubject_sam|trigger=none}{code:language=javascript}
		str += 'Sent on: ' + msg.getSentDate() + '\n\n';
		str += 'Subject: ' + msg.getSubject() + '\n\n';
		str += 'Plain message: ' + msg.getPlainMsg() + '\n\n';
		str += 'HTML message: ' + msg.getHtmlMsg() + '\n\n';
		str += 'Headers: ' + msg.getHeaders() + '\n\n';
		var attachments = msg.getAttachments();
		if (attachments != null) {
			str += 'Number of attachments: ' + attachments.length + '\n\n';
			for (var j=0; j < attachments.length; j++)
			{
				var attachment = attachments[j];
				str += 'Attachment ' + j + '\n';
				str += '	Name: ' + attachment.getName() + '\n';
				str += '	Size: ' + attachment.getData().length + '\n\n';
			}
		}
		plugins.file.writeTXTFile('msg' + i + '.txt', str);
		application.output('Message ' + i + ' retrieved.');
	}
}
else
{
	application.output("Failed to retrieve messages.");
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetSentDate
Table Row (tr)
idname
Table Cell (td)

getSentDate

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
Date
Span
stylefont-weight: bold;
getSentDate
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns a Date instance corresponding to the moment when this message was sent.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
Date
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var msgs = plugins.mail.receiveMail(username, password, true, 0, null, properties);
if (msgs != null)
{
	for (var i=0; i < msgs.length; i++)
	{
		var msg = msgs[i];
		var str = '';
		str += 'From: ' + msg.getFromAddresses() + '\n';
		str += 'To: ' + msg.getRecipientAddresses() + '\n';
		str += 'CC: ' + msg.getCCAddresses() + '\n';
		str += 'Reply to: ' + msg.getReplyAddresses() + '\n';
		str += 'Received on: ' + msg.getReceivedDate() + '\n';
		str += 'Sent on: ' + msg.getSentDate() + '\n\n';
		str += 'Subject: ' + msg.getSubject() + '\n\n';
		str += 'Plain message: ' + msg.getPlainMsg() + '\n\n';
		str += 'HTML message: ' + msg.getHtmlMsg() + '\n\n';
		str += 'Headers: ' + msg.getHeaders() + '\n\n';
		var attachments = msg.getAttachments();
		if (attachments != null) {
			str += 'Number of attachments: ' + attachments.length + '\n\n';
			for (var j=0; j < attachments.length; j++)
			{
				var attachment = attachments[j];
				str += 'Attachment ' + j + '\n';
				str += '	Name: ' + attachment.getName() + '\n';
				str += '	Size: ' + attachment.getData().length + '\n\n';
			}
		}
		plugins.file.writeTXTFile('msg' + i + '.txt', str);
		application.output('Message ' + i + ' retrieved.');
	}
}
else
{
	application.output("Failed to retrieve messages.");
}
Table Row (tr)
classlastDetailRow
Table Cell (td)
 
Table Body (tbody)
idgetSubject
Table Row (tr)
idname
Table Cell (td)

getSubject

Table Row (tr)
idsig
Table Cell (td)
Span
stylemargin-right: 5px;
String
Span
stylefont-weight: bold;
getSubject
Span
()
Table Row (tr)
iddes
Table Cell (td)
Div
classsIndent
Returns a String with the subject of this message.
Table Row (tr)
idret
Table Cell (td)

Returns

Div
classsIndent
String
Table Row (tr)
idsam
Table Cell (td)

Sample

Div
classsIndent
Code Block
languagejavascript
var msgs = plugins.mail.receiveMail(username, password, true, 0, null, properties);
if (msgs != null)
{
	for (var i=0; i < msgs.length; i++)
	{
		var msg = msgs[i];
		var str = '';
		str += 'From: ' + msg.getFromAddresses() + '\n';
		str += 'To: ' + msg.getRecipientAddresses() + '\n';
		str += 'CC: ' + msg.getCCAddresses() + '\n';
		str += 'Reply to: ' + msg.getReplyAddresses() + '\n';
		str += 'Received on: ' + msg.getReceivedDate() + '\n';
		str += 'Sent on: ' + msg.getSentDate() + '\n\n';
		str += 'Subject: ' + msg.getSubject() + '\n\n';
		str += 'Plain message: ' + msg.getPlainMsg() + '\n\n';
		str += 'HTML message: ' + msg.getHtmlMsg() + '\n\n';
		str += 'Headers: ' + msg.getHeaders() + '\n\n';
		var attachments = msg.getAttachments();
		if (attachments != null) {
			str += 'Number of attachments: ' + attachments.length + '\n\n';
			for (var j=0; j < attachments.length; j++)
			{
				var attachment = attachments[j];
				str += 'Attachment ' + j + '\n';
				str += '	Name: ' + attachment.getName() + '\n';
				str += '	Size: ' + attachment.getData().length + '\n\n';
			}
		}
		plugins.file.writeTXTFile('msg' + i + '.txt', str);
		application.output('Message ' + i + ' retrieved.');
	}
}
else
{
	application.output("Failed to retrieve messages.");
}
{code}{sub-section}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
Table Row (tr)
classlastDetailRow
Table Cell (td)