midrange.com code scratchpad
Name:
MMAIL XMLi Template
Scriptlanguage:
Plain Text
Tabwidth:
4
Date:
03/22/2011 11:10:26 pm
IP:
Logged
Description:
Example XMLi Template using MMAIL
Code:
  1. <xmli:template xmlns:xmli="http://www.sourceforge.net/xmli"
  2.                xmlns:mmail="http://www.larryducie.com/mmail" ccsid="819" format="pretty" >
  3.  
  4.      <html>
  5.         <body>
  6.            <h1>Heading 1</h1>
  7.             <xmli:value-of select="'Some text below heading 1'" />
  8.         </body>
  9.      </html>
  10.           
  11.     <!-- Simple text message -->          
  12.     <mmail:send>
  13.         <mmail:sender name="Test For MMAIL" address="me@there.com"/>
  14.         <mmail:subject>Hooray, it worked! Test Subject from XMLi MMAIL Extension</mmail:subject>
  15.         <mmail:body content-type="text/html"><mmail:document/></mmail:body>
  16.         
  17.         <xmli:run-sql name="recipients" naming="SYS" statement="select name, address
  18.                                                                  from someFile
  19.                                                                  where something = somethingElse 
  20.                                                                  order by someValue, someOtherValue">
  21.         </xmli:run-sql>
  22.         <xmli:for-each>
  23.             <mmail:recipient type="to" name="${recipients.1}" address="${recipients.2}"/>            
  24.         </xmli:for-each>
  25.                 
  26.         <mmail:attach disposition="imbed" binary="true" path="/mmail/image/giovanni.jpg"/>
  27.         <mmail:attach disposition="attach" binary="true" path="/mmail/image/paper1.gif"/>
  28.         <mmail:attach disposition="attach" binary="true" path="/mmail/audio/cheering.wav"/>
  29.     </mmail:send>
  30.  
  31. </xmli:template>
  32.  
  33.  
© 2004-2019 by midrange.com generated in 0.007s valid xhtml & css