Attached is code for a SendMail task and a diff for defaults.properties. I
hope this task can be useful to others - I've gotten very attached to it.
Here is an example usage:

        <target name="finish" unless="${build.failed}">
                <sendmail
                        from="[EMAIL PROTECTED]"
                        toList="[EMAIL PROTECTED],
[EMAIL PROTECTED]"
                        subject="Build ${build.id} : OK"
                        files="${changes.txt}, ${build.log}" />
        </target>

There are a few cleanup items that I would like to get to:

* replace toList attribute with "to" subelements.
* replace files attribute with "file" subelements, and send these files as
attachments. Currently, the text from the file is written in the body of the
mail message.

Thanks!

Glenn.

Attachment: SendMail.java
Description: Binary data

Index: src/main/org/apache/tools/ant/taskdefs/defaults.properties
===================================================================
RCS file: 
/home/cvspublic/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/defaults.properties,v
retrieving revision 1.35
diff -r1.35 defaults.properties
42a43
> mail=org.apache.tools.ant.taskdefs.SendMail

Reply via email to