2001-02-13 12:32:01 +00:00
|
|
|
<html>
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Language" content="en-us">
|
2002-02-03 22:00:42 +00:00
|
|
|
<title>Mail Task</title>
|
2001-02-13 12:32:01 +00:00
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<h2><a name="mail">Mail</a></h2>
|
|
|
|
<h3>Description</h3>
|
2002-02-05 09:32:48 +00:00
|
|
|
<p>A task to send SMTP email. This task can send mail using either plain
|
|
|
|
text, uu encoding or Mime format mail depending on what is available.
|
|
|
|
Attachments may be sent using nested
|
|
|
|
<a href="../CoreTypes/fileset.html">fileset</a> elements.</p>
|
2001-08-30 13:23:14 +00:00
|
|
|
|
2001-02-13 12:32:01 +00:00
|
|
|
<h3>Parameters</h3>
|
|
|
|
<table border="1" cellpadding="2" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<td valign="top"><b>Attribute</b></td>
|
|
|
|
<td valign="top"><b>Description</b></td>
|
|
|
|
<td align="center" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">from</td>
|
|
|
|
<td valign="top">Email address of sender.</td>
|
2002-02-05 09:32:48 +00:00
|
|
|
<td align="center" valign="top">Either a <code>from</code> attribute, or a <code><from></code>
|
|
|
|
element.</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">tolist</td>
|
|
|
|
<td valign="top">Comma-separated list of recipients.</td>
|
2002-02-05 09:32:48 +00:00
|
|
|
<td align="center" valign="middle" rowspan="3">At least one of these, or the
|
|
|
|
equivalent elements.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">cclist</td>
|
|
|
|
<td valign="top">Comma-separated list of recipients to carbon copy</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">bcclist</td>
|
|
|
|
<td valign="top">Comma-separated list of recipients to carbon copy</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">message</td>
|
|
|
|
<td valign="top">Message to send in the body of the email.</td>
|
2002-02-05 09:32:48 +00:00
|
|
|
<td align="center" valign="middle" rowspan="2">One of these or a
|
|
|
|
<code><message></code> element.</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">messagefile</td>
|
|
|
|
<td valign="top">File to send as the body of the email.</td>
|
|
|
|
</tr>
|
|
|
|
<td valign="top">messagemimetype</td>
|
|
|
|
<td valign="top">The content type of the message. The default is
|
|
|
|
<code>text/plain</code>.</td>
|
|
|
|
<td align="center" valign="top">No</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">files</td>
|
2002-02-05 09:32:48 +00:00
|
|
|
<td valign="top">Files to send as attachments to the email. Separate multiple
|
|
|
|
file names using a comma. You can also use <code><fileset></code>
|
|
|
|
elements to specify files.</td>
|
|
|
|
<td align="center" valign="top">No</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
2002-01-02 05:16:41 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">failonerror</td>
|
2002-02-05 09:32:48 +00:00
|
|
|
<td valign="top">flag to indicate whether to halt the build on
|
|
|
|
any error. The default value is <code>true</code>.</td>
|
|
|
|
<td align="center" valign="top">No.</td>
|
|
|
|
</tr>
|
2001-12-10 18:01:16 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">includefilenames</td>
|
|
|
|
<td valign="top">Include filename(s) before file contents.
|
2002-02-05 09:32:48 +00:00
|
|
|
Valid only when the <code>plain</code> encoding is used. The default
|
|
|
|
value is <code>false</code>.</td>
|
|
|
|
<td align="center" valign="top">No</td>
|
2001-12-10 18:01:16 +00:00
|
|
|
</tr>
|
2001-02-13 12:32:01 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">mailhost</td>
|
2002-02-05 09:32:48 +00:00
|
|
|
<td valign="top">Host name of the SMTP server. The default value is
|
|
|
|
<code>localhost</code>.</td>
|
|
|
|
<td align="center" valign="top">No</td>
|
2001-02-13 12:32:01 +00:00
|
|
|
</tr>
|
2001-11-15 22:11:28 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">mailport</td>
|
2002-02-05 09:32:48 +00:00
|
|
|
<td valign="top">TCP port of the SMTP server. The default value is 25.</td>
|
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">encoding</td>
|
|
|
|
<td valign="top">Specifies the encoding to use for the content of the email.
|
|
|
|
Values are <code>mime</code>, <code>uu</code>, <code>plain</code>, or
|
|
|
|
<code>auto</code>. The default value is <code>auto</code>.</td>
|
|
|
|
<td align="center" valign="top">No</td>
|
2001-11-15 22:11:28 +00:00
|
|
|
</tr>
|
2001-02-13 12:32:01 +00:00
|
|
|
<tr>
|
|
|
|
<td valign="top">subject</td>
|
|
|
|
<td valign="top">Email subject line.</td>
|
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
2002-02-05 09:32:48 +00:00
|
|
|
|
|
|
|
<h3>Parameters specified as nested elements</h3>
|
|
|
|
|
|
|
|
<h4>to / cc / bcc / from</h4>
|
|
|
|
<p>Adds an email address element. It takes the following attributes:</p>
|
|
|
|
|
|
|
|
<table width="60%" border="1" cellpadding="2" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<td valign="top"><b>Attribute</b></td>
|
|
|
|
<td valign="top"><b>Description</b></td>
|
|
|
|
<td align="center" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">name</td>
|
|
|
|
<td valign="top">The display name for the address.</td>
|
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">address</td>
|
|
|
|
<td valign="top">The email address.</td>
|
|
|
|
<td align="center" valign="top">Yes</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<h4>message</h4>
|
|
|
|
|
|
|
|
<p>Specifies the message to include in the email body. It takes the following
|
|
|
|
attributes:</p>
|
|
|
|
|
|
|
|
<table width="60%" border="1" cellpadding="2" cellspacing="0">
|
|
|
|
<tr>
|
|
|
|
<td valign="top"><b>Attribute</b></td>
|
|
|
|
<td valign="top"><b>Description</b></td>
|
|
|
|
<td align="center" valign="top"><b>Required</b></td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">src</td>
|
|
|
|
<td valign="top">The file to use as the message.</td>
|
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td valign="top">mimetype</td>
|
|
|
|
<td valign="top">The content type to use for the message.</td>
|
|
|
|
<td align="center" valign="top">No</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<p>If the <code>src</code> attribute is not specified, then text can be added
|
|
|
|
inside the <code><message></code> element.</p>
|
|
|
|
|
2001-02-13 12:32:01 +00:00
|
|
|
<h3>Examples</h3>
|
2002-02-05 09:32:48 +00:00
|
|
|
|
|
|
|
<blockquote><pre>
|
|
|
|
<mail from="me"
|
|
|
|
tolist="you"
|
|
|
|
subject="Results of nightly build"
|
|
|
|
files="build.log" />
|
|
|
|
</pre></blockquote>
|
|
|
|
|
|
|
|
<p>Sends an email from <i>me</i> to <i>you</i> with a subject of
|
|
|
|
<i>Results of nightly build</i> and includes the contents of the file
|
|
|
|
<i>build.log</i> in the body of the message.</p>
|
|
|
|
|
|
|
|
<blockquote><pre>
|
|
|
|
<mail mailhost="smtp.myisp.com" mailport="1025" subject="Test build">
|
|
|
|
<from name="me@myisp.com">
|
|
|
|
<to name="all@xyz.com">
|
|
|
|
<message>A new nightly build has completed</message>
|
|
|
|
<fileset dir="dist">
|
|
|
|
<includes name="**/*.zip"/>
|
|
|
|
</fileset>
|
|
|
|
</mail>
|
|
|
|
</pre></blockquote>
|
|
|
|
|
|
|
|
<p>Sends an eMail from <i>me@myisp.com</i> to <i>all@xyz.com</i> with a subject of
|
|
|
|
<i>Test Build</i> and attaches any zip files from the dist directory. The
|
|
|
|
task will attempt to use JavaMail and fall back to UU encoding or no encoding in
|
|
|
|
that order depending on what support classes are available.</p>
|
2001-02-13 12:32:01 +00:00
|
|
|
<hr>
|
2002-06-01 12:26:43 +00:00
|
|
|
<p align="center">Copyright © 2000-2002 Apache Software Foundation. All rights
|
2001-02-13 12:32:01 +00:00
|
|
|
Reserved.</p>
|
|
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|
|
|