You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

mail.html 6.1 KiB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <title>Mail Task</title>
  5. </head>
  6. <body>
  7. <h2><a name="mail">Mail</a></h2>
  8. <h3>Description</h3>
  9. <p>A task to send SMTP email. This task can send mail using either plain
  10. text, uu encoding or Mime format mail depending on what is available.
  11. Attachments may be sent using nested
  12. <a href="../CoreTypes/fileset.html">fileset</a> elements.</p>
  13. <h3>Parameters</h3>
  14. <table border="1" cellpadding="2" cellspacing="0">
  15. <tr>
  16. <td valign="top"><b>Attribute</b></td>
  17. <td valign="top"><b>Description</b></td>
  18. <td align="center" valign="top"><b>Required</b></td>
  19. </tr>
  20. <tr>
  21. <td valign="top">from</td>
  22. <td valign="top">Email address of sender.</td>
  23. <td align="center" valign="top">Either a <code>from</code> attribute, or a <code>&lt;from&gt;</code>
  24. element.</td>
  25. </tr>
  26. <tr>
  27. <td valign="top">tolist</td>
  28. <td valign="top">Comma-separated list of recipients.</td>
  29. <td align="center" valign="middle" rowspan="3">At least one of these, or the
  30. equivalent elements.</td>
  31. </tr>
  32. <tr>
  33. <td valign="top">cclist</td>
  34. <td valign="top">Comma-separated list of recipients to carbon copy</td>
  35. </tr>
  36. <tr>
  37. <td valign="top">bcclist</td>
  38. <td valign="top">Comma-separated list of recipients to carbon copy</td>
  39. </tr>
  40. <tr>
  41. <td valign="top">message</td>
  42. <td valign="top">Message to send in the body of the email.</td>
  43. <td align="center" valign="middle" rowspan="2">One of these or a
  44. <code>&lt;message&gt;</code> element.</td>
  45. </tr>
  46. <tr>
  47. <td valign="top">messagefile</td>
  48. <td valign="top">File to send as the body of the email.</td>
  49. </tr>
  50. <td valign="top">messagemimetype</td>
  51. <td valign="top">The content type of the message. The default is
  52. <code>text/plain</code>.</td>
  53. <td align="center" valign="top">No</td>
  54. </tr>
  55. <tr>
  56. <td valign="top">files</td>
  57. <td valign="top">Files to send as attachments to the email. Separate multiple
  58. file names using a comma. You can also use <code>&lt;fileset&gt;</code>
  59. elements to specify files.</td>
  60. <td align="center" valign="top">No</td>
  61. </tr>
  62. <tr>
  63. <td valign="top">failonerror</td>
  64. <td valign="top">flag to indicate whether to halt the build on
  65. any error. The default value is <code>true</code>.</td>
  66. <td align="center" valign="top">No.</td>
  67. </tr>
  68. <tr>
  69. <td valign="top">includefilenames</td>
  70. <td valign="top">Include filename(s) before file contents.
  71. Valid only when the <code>plain</code> encoding is used. The default
  72. value is <code>false</code>.</td>
  73. <td align="center" valign="top">No</td>
  74. </tr>
  75. <tr>
  76. <td valign="top">mailhost</td>
  77. <td valign="top">Host name of the SMTP server. The default value is
  78. <code>localhost</code>.</td>
  79. <td align="center" valign="top">No</td>
  80. </tr>
  81. <tr>
  82. <td valign="top">mailport</td>
  83. <td valign="top">TCP port of the SMTP server. The default value is 25.</td>
  84. <td align="center" valign="top">No</td>
  85. </tr>
  86. <tr>
  87. <td valign="top">encoding</td>
  88. <td valign="top">Specifies the encoding to use for the content of the email.
  89. Values are <code>mime</code>, <code>uu</code>, <code>plain</code>, or
  90. <code>auto</code>. The default value is <code>auto</code>.</td>
  91. <td align="center" valign="top">No</td>
  92. </tr>
  93. <tr>
  94. <td valign="top">subject</td>
  95. <td valign="top">Email subject line.</td>
  96. <td align="center" valign="top">No</td>
  97. </tr>
  98. </table>
  99. <h3>Parameters specified as nested elements</h3>
  100. <h4>to / cc / bcc / from</h4>
  101. <p>Adds an email address element. It takes the following attributes:</p>
  102. <table width="60%" border="1" cellpadding="2" cellspacing="0">
  103. <tr>
  104. <td valign="top"><b>Attribute</b></td>
  105. <td valign="top"><b>Description</b></td>
  106. <td align="center" valign="top"><b>Required</b></td>
  107. </tr>
  108. <tr>
  109. <td valign="top">name</td>
  110. <td valign="top">The display name for the address.</td>
  111. <td align="center" valign="top">No</td>
  112. </tr>
  113. <tr>
  114. <td valign="top">address</td>
  115. <td valign="top">The email address.</td>
  116. <td align="center" valign="top">Yes</td>
  117. </tr>
  118. </table>
  119. <h4>message</h4>
  120. <p>Specifies the message to include in the email body. It takes the following
  121. attributes:</p>
  122. <table width="60%" border="1" cellpadding="2" cellspacing="0">
  123. <tr>
  124. <td valign="top"><b>Attribute</b></td>
  125. <td valign="top"><b>Description</b></td>
  126. <td align="center" valign="top"><b>Required</b></td>
  127. </tr>
  128. <tr>
  129. <td valign="top">src</td>
  130. <td valign="top">The file to use as the message.</td>
  131. <td align="center" valign="top">No</td>
  132. </tr>
  133. <tr>
  134. <td valign="top">mimetype</td>
  135. <td valign="top">The content type to use for the message.</td>
  136. <td align="center" valign="top">No</td>
  137. </tr>
  138. </table>
  139. <p>If the <code>src</code> attribute is not specified, then text can be added
  140. inside the <code>&lt;message&gt;</code> element.</p>
  141. <h3>Examples</h3>
  142. <blockquote><pre>
  143. &lt;mail from=&quot;me&quot;
  144. tolist=&quot;you&quot;
  145. subject=&quot;Results of nightly build&quot;
  146. files=&quot;build.log&quot; /&gt;
  147. </pre></blockquote>
  148. <p>Sends an email from <i>me</i> to <i>you</i> with a subject of
  149. <i>Results of nightly build</i> and includes the contents of the file
  150. <i>build.log</i> in the body of the message.</p>
  151. <blockquote><pre>
  152. &lt;mail mailhost=&quot;smtp.myisp.com&quot; mailport=&quot;1025&quot; subject=&quot;Test build&quot;&gt;
  153. &lt;from name=&quot;me@myisp.com&quot;&gt;
  154. &lt;to name=&quot;all@xyz.com&quot;&gt;
  155. &lt;message&gt;A new nightly build has completed&lt;/message&gt;
  156. &lt;fileset dir=&quot;dist&quot;&gt;
  157. &lt;includes name=&quot;**/*.zip&quot;/&gt;
  158. &lt;/fileset&gt;
  159. &lt;/mail&gt;
  160. </pre></blockquote>
  161. <p>Sends an eMail from <i>me@myisp.com</i> to <i>all@xyz.com</i> with a subject of
  162. <i>Test Build</i> and attaches any zip files from the dist directory.&nbsp; The
  163. task will attempt to use JavaMail and fall back to UU encoding or no encoding in
  164. that order depending on what support classes are available.</p>
  165. <hr>
  166. <p align="center">Copyright &copy; 2001-2002 Apache Software Foundation. All rights
  167. Reserved.</p>
  168. </body>
  169. </html>