Child pages
  • MailMessage

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{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: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}[#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:width=100%|padding=0px}{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}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getAttachments_des|trigger=button|text=}{sub-section}{sub-section:getAttachments_des|trigger=none|class=sIndent}ReturnsReplace an array of Attachment instances corresponding to the attachments of this message.with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getAttachments_snc|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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() + '\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=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}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getCCAddresses_des|trigger=button|text=}{sub-section}{sub-section:getCCAddresses_des|trigger=none|class=sIndent}Returns a StringReplace with all addresses present in the CC field of this message.description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getCCAddresses_snc|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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[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}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getFromAddresses_des|trigger=button|text=}{sub-section}{sub-section:getFromAddresses_des|trigger=none|class=sIndent}Returns a StringReplace with all addresses present in the From field of this message.description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getFromAddresses_snc|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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() + '\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=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}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getHeaders_des|trigger=button|text=}{sub-section}{sub-section:getHeaders_des|trigger=none|class=sIndent}Returns a StringReplace with all headers of this message.description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getHeaders_snc|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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 = '';
		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=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}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getHtmlMsg_des|trigger=button|text=}{sub-section}{sub-section:getHtmlMsg_des|trigger=none|class=sIndent}Returns aReplace String with the HTML content of this message.description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getHtmlMsg_snc|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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() + '\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=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}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getPlainMsg_des|trigger=button|text=}{sub-section}{sub-section:getPlainMsg_des|trigger=none|class=sIndent}Returns a StringReplace with the plain content of this message.description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getPlainMsg_snc|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getRecipientAddresses_des|trigger=button|text=}{sub-section}{sub-section:getRecipientAddresses_des|trigger=none|class=sIndent}Returns aReplace String with all addresses in the To field of this message. description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getRecipientAddresses_snc|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getReplyAddresses_des|trigger=button|text=}{sub-section}{sub-section:getReplyAddresses_des|trigger=none|class=sIndent}Returns a StringReplace with all addresses in the Reply\-To field of this message.description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getReplyAddresses_snc|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getSentDate_des|trigger=button|text=}{sub-section}{sub-section:getSentDate_des|trigger=none|class=sIndent}ReturnsReplace a Date instance corresponding to the moment when this message was sent.with description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getSentDate_snc|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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}{builder-show:permission=edit}{tr:id=des}{td}{sub-section:getSubject_des|trigger=button|text=}{sub-section}{sub-section:getSubject_des|trigger=none|class=sIndent}Returns aReplace String with the subject of this message.description{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=snc}{td}*Since*\\{sub-section:getSubject_snc|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{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|trigger=button|text=}{sub-section}{div:class=sIndent}{sub-section:getSubject_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}{table}