Or you could use a BuildListener - a better approach if the build fails.
There's a sample in the ant archives at
http://jakarta.apache.org/jyve-faq/Turbine/screen/DisplayQuestionAnswer/acti
on/SetAll/project_id/2/faq_id/16/topic_id/196/question_id/741
I use a modified version to send SMS notifications through our company
gateway as well - seriously cool when you're down the pub and the overnight
build kicks in :-)
Bye,
Les.
> -----Original Message-----
> From: Steve Donie [mailto:[EMAIL PROTECTED]]
> Sent: 10 January 2001 06:03
> To: '[EMAIL PROTECTED]'
> Subject: RE: sending mail with build log file included
>
>
> What I did was write 2 files - build.xml does the actual
> build, but mail.xml
> just uses the exec task to "call" build.xml and sent the
> output to a log
> file, which is them mailed using the mail task. After I wrote
> this (my first
> day using Ant) I realized I could change it to use the Ant
> task instead of
> exec, I just haven't changed it yet.
>
> <project name="Mail" default="mail" basedir="..">
>
> <target name="mail">
> <exec executable="ant.bat" dir="${basedir}/tools"
> output="tools/build.log">
> </exec>
> <mail from="[EMAIL PROTECTED]" tolist="sdonie"
> subject="Results of nightly
> build"
> files="tools/build.log" mailhost="mailhost" />
> </target>
>
> </project>
>
>
>
> > -----Original Message-----
> > From: Sibon Barman [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, January 09, 2001 2:58 PM
> > To: ant
> > Subject: sending mail with build log file included
> >
> > Hi all,
> > I have a question on how to create a buildfile that will
> allow me to send
> > an email to load administrator at the end of the build with
> build log file
> > included in that email. I know there is a built in task
> called Mail --- if
> > somebody could send me a snippet of xml on how to to it,
> that would be
> > great.
> >
> > Thanks,
> >
> > Sibon Barman
> > SS8 Networks, Inc.
> > Suite 500
> > 495 March Road, Kanata,
> > Ontario K2K 3G1
> >
> > *: (613)592-2100 ext:3281
> > *: [EMAIL PROTECTED]
> >
> >
>