Attached is the MimeMail task originally submitted by Steve Loughran, and subsequently modified by me to use FileSets instead of the 'files' attribute, and also modified by Paulo Gaspar to include CC and BCC.
I have not checked this for JDK 1.1 compliance - is there anything here that
is not compatible?
I've also included an Ant-styled manual document describing its use.
Let me know if there is anything else I can do for this task in order to get
it committed as an optional task. There are dependencies on JavaMail and
the Java Activation Framework that need to be there when optional.jar is
built for the next release.
Thanks,
Erik
MimeMail.java
Description: java/
MimeMail
Description
Sends SMTP mail with MIME attachments. If no attachments are needed, use the built-in Mail task. JavaMail and Java Activation Framework are required for this task.
Multiple files can be attached using FileSets.
Parameters
| 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" |
Examples
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>
Copyright © 2000,2001 Apache Software Foundation. All rights Reserved.
