This task has been deprecated. Use the mail task instead.
Sends SMTP mail with MIME attachments.
JavaMail
and Java
Activation Framework are required for this task. The Java
Activation Framework is part of the standard class library for Java 6
to Java 10 but the java.activation
module has been
deprecated in Java 9 and must be enabled explicitly when running on
Java 10. Alternatively it can be provided as an external library.
Multiple files can be attached using FileSets.
Attribute | Description | Required |
message | The message body | No, but only one of of 'message' or 'messageFile' may be specified. If not specified, a fileset must be provided. |
messageFile | A filename to read and used as the message body | |
messageMimeType | MIME type to use for 'message' or 'messageFile' when attached. | No, defaults to "text/plain" |
tolist | Comma-separated list of To: recipients | Yes, at least one of 'tolist', 'cclist', or 'bcclist' must be specified. |
cclist | Comma-separated list of CC: recipients | |
bcclist | Comma-separated list of BCC: recipients | |
mailhost | Host name of the mail server. | No, default to "localhost" |
subject | Email subject line. | No |
from | Email address of sender. | Yes |
failonerror | Stop the build process if an error occurs sending the e-mail. | No, default to "true" |
Send a single HTML file as the body of a message
<mimemail messageMimeType="text/html" messageFile="overview-summary.html" tolist="you" subject="JUnit Test Results: ${TODAY}" from="me"/>
Sends all files in a directory as attachments
<mimemail message="See attached files" tolist="you" subject="Attachments" from="me"> <fileset dir="."> <include name="dist/*.*"/> </fileset> </mimemail>