Simple XPage to test mail routing

<?xml version="1.0" encoding="UTF-8"?>
<xp:view xmlns:xp="http://www.ibm.com/xsp/core">
<xp:br></xp:br>
	<xp:br></xp:br>
	<xp:table>
		<xp:tr>
			<xp:td></xp:td>
			<xp:td>Simple&#160;XPage to test mail routing. <xp:br></xp:br>GMail does not seem to like the principal field so option 3 is probably the preferred one.
 <xp:br></xp:br>see&#160;
				<xp:link escape="true" id="link1" text="http://seancull.co.uk/public/seancull.nsf/dx/mail_principal_domino_gmal.htm" value="http://seancull.co.uk/public/seancull.nsf/dx/mail_principal_domino_gmal.htm"></xp:link>
				<xp:br></xp:br><xp:br></xp:br>Enter the details below and press send to check the mail routing<xp:br></xp:br></xp:td>
			<xp:td></xp:td>
		</xp:tr>
		<xp:tr>
			<xp:td></xp:td>
			<xp:td>send to<xp:br></xp:br>
	<xp:inputText id="inputText1" value="#{viewScope.sendto}"></xp:inputText>
	<xp:br></xp:br>
	<xp:br></xp:br>copy to<xp:br></xp:br>
	<xp:inputText id="inputText5" value="#{viewScope.copyto}"></xp:inputText>
	<xp:br></xp:br>
	
	<xp:br></xp:br>send from
	<xp:br></xp:br><xp:inputText id="inputText4" value="#{viewScope.sendfrom}"></xp:inputText>
	&#160;&#160;&#160;&#160;
	<xp:br></xp:br><xp:br></xp:br><xp:br></xp:br>subject<xp:br></xp:br>
	<xp:inputText id="inputText2" value="#{viewScope.subject}" style="width:278.0px">
	</xp:inputText>
	<xp:br></xp:br>
	<xp:br></xp:br>
	<xp:br></xp:br>body<xp:br></xp:br>
	<xp:inputText id="inputText3" style="width:281.0px;height:192.0px" value="#{viewScope.body}">
	</xp:inputText>
	</xp:td>
			<xp:td></xp:td>
		</xp:tr>
	</xp:table>
	<xp:br></xp:br>
	<xp:table border="1">
		<xp:tr>
			<xp:td><xp:button value="send test email bttn 1" id="button1">
	<xp:eventHandler event="onclick" submit="true"
		refreshMode="complete">
		<xp:this.action><![CDATA[#{javascript:var maildoc = database.createDocument();
maildoc.appendItemValue("sendto",viewScope.sendto);
maildoc.appendItemValue("copyto",viewScope.copyto);
maildoc.appendItemValue("subject",viewScope.subject + ' bttn 1');
maildoc.appendItemValue("body",viewScope.body);
maildoc.send()}]]></xp:this.action>
	</xp:eventHandler></xp:button></xp:td>
			<xp:td>var maildoc = database.createDocument();<xp:br></xp:br>
maildoc.appendItemValue(&quot;sendto&quot;,viewScope.sendto)<xp:br></xp:br>maildoc.appendItemValue(&quot;copyto&quot;,viewScope.copyto);
<xp:br></xp:br>maildoc.appendItemValue(&quot;subject&quot;,viewScope.subject + ' bttn 1')
<xp:br></xp:br>maildoc.appendItemValue(&quot;body&quot;,viewScope.body)
<xp:br></xp:br>maildoc.send()</xp:td>
		</xp:tr>
		<xp:tr>
			<xp:td><xp:button value="send test email bttn 2" id="button8">
	<xp:eventHandler event="onclick" submit="true"
		refreshMode="complete">
		<xp:this.action><![CDATA[#{javascript:var maildoc = database.createDocument();
maildoc.appendItemValue("sendto",viewScope.sendto);
maildoc.appendItemValue("copyto",viewScope.copyto);
maildoc.appendItemValue("subject",viewScope.subject + ' bttn 2');
maildoc.appendItemValue("body",viewScope.body);
maildoc.appendItemValue("principal",viewScope.sendfrom)
maildoc.send()}]]></xp:this.action>
	</xp:eventHandler></xp:button></xp:td>
			<xp:td>var maildoc = database.createDocument();<xp:br></xp:br>
maildoc.appendItemValue(&quot;sendto&quot;,viewScope.sendto)<xp:br></xp:br>maildoc.appendItemValue(&quot;copyto&quot;,viewScope.copyto)
<xp:br></xp:br>maildoc.appendItemValue(&quot;subject&quot;,viewScope.subject + ' bttn 2)
<xp:br></xp:br>maildoc.appendItemValue(&quot;body&quot;,viewScope.body)
				<xp:br></xp:br>
				<xp:br></xp:br>
				maildoc.appendItemValue(&quot;principal&quot;,viewScope.sendfrom)
<xp:br></xp:br><xp:br></xp:br>maildoc.send()</xp:td>
		</xp:tr>
		<xp:tr>
			<xp:td><xp:button value="send test email bttn 3" id="button9">
	<xp:eventHandler event="onclick" submit="true"
		refreshMode="complete">
		<xp:this.action><![CDATA[#{javascript:var maildoc = database.createDocument();
maildoc.appendItemValue("sendto",viewScope.sendto);
maildoc.appendItemValue("copyto",viewScope.copyto);
maildoc.appendItemValue("subject",viewScope.subject + ' bttn 3');
maildoc.appendItemValue("body",viewScope.body);
maildoc.appendItemValue("InetFrom",viewScope.sendfrom);
maildoc.send()}]]></xp:this.action>
	</xp:eventHandler></xp:button></xp:td>
			<xp:td>var maildoc = database.createDocument();<xp:br></xp:br>
maildoc.appendItemValue(&quot;sendto&quot;,viewScope.sendto)<xp:br></xp:br>maildoc.appendItemValue(&quot;copyto&quot;,viewScope.copyto)
<xp:br></xp:br>maildoc.appendItemValue(&quot;subject&quot;,viewScope.subject + ' bttn 3)
<xp:br></xp:br>maildoc.appendItemValue(&quot;body&quot;,viewScope.body)
				<xp:br></xp:br>
				<xp:br></xp:br>
				maildoc.appendItemValue(&quot;InetFrom&quot;,viewScope.sendfrom)
<xp:br></xp:br>
				<xp:br></xp:br>
				maildoc.send()
			</xp:td>
		</xp:tr>
		<xp:tr>
			<xp:td><xp:button value="send test email bttn 4" id="button10">
	<xp:eventHandler event="onclick" submit="true"
		refreshMode="complete">
		<xp:this.action><![CDATA[#{javascript:var maildoc = database.createDocument();
maildoc.appendItemValue("sendto",viewScope.sendto);
maildoc.appendItemValue("copyto",viewScope.copyto);
maildoc.appendItemValue("subject",viewScope.subject + ' bttn 4');
maildoc.appendItemValue("body",viewScope.body);
maildoc.appendItemValue("InetFrom",viewScope.sendfrom);
maildoc.replaceItemValue('tmpDisplaySentBy', viewScope.sendfrom);
maildoc.replaceItemValue('DisplaySent', viewScope.sendfrom);

maildoc.send()}]]></xp:this.action>
	</xp:eventHandler></xp:button></xp:td>
			<xp:td>var maildoc = database.createDocument();<xp:br></xp:br>
maildoc.appendItemValue(&quot;sendto&quot;,viewScope.sendto)
				<xp:br></xp:br>maildoc.appendItemValue(&quot;copyto&quot;,viewScope.copyto)
				<xp:br></xp:br>maildoc.appendItemValue(&quot;subject&quot;,viewScope.subject + ' bttn 4)
<xp:br></xp:br>maildoc.appendItemValue(&quot;body&quot;,viewScope.body)
				<xp:br></xp:br>
				<xp:br></xp:br>
				maildoc.appendItemValue(&quot;InetFrom&quot;,viewScope.sendfrom)<xp:br></xp:br>maildoc.replaceItemValue('tmpDisplaySentBy', viewScope.sendfrom);
<xp:br></xp:br>maildoc.replaceItemValue('DisplaySent', viewScope.sendfrom)
<xp:br></xp:br>
				<xp:br></xp:br>
				maildoc.send()
			</xp:td>
		</xp:tr>
	</xp:table>
	</xp:view>





A simple XPage to test mail routing.
Also useful for testing new server installations
Developed to troubleshoot issues with GMail and the principal field
see http://seancull.co.uk/public/seancull.nsf/dx/mail_principal_domino_gmal.htm

XPages
sean cull
June 30, 2013 9:33 AM
Rating
164

All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.



2 comment(s)Login first to comment...
jeniffer homes
(at 07:51 on 19.12.2015)
Built-in methods of the XSPUserAgent class in XPages do not recognize IE 11
Anonymous
(at 07:48 on 19.12.2015)
. This snippet detects IE 11 based on the user agent string.