1. 去
java.sun.com官方网站去搜,下载javamail和JAF两个包,只要取其中的mail.jar和activaction.jar,放到Ant的lib文件夹下
2.
<target
name="sendmail">
<mail mailhost="namail.****.com" mailport="25" subject="Test build">
<from address="nobody@adobe.com"/>
<replyto address="nobody@adobe.com"/>
<to address="lolin@adobe.com"/>
<message>The nightly build has completed</message>
<attachments>
<fileset dir="${deploy.dir}">
<include name="**/*.zip"/>
</fileset>
</attachments>
</mail>
</target>
<mail mailhost="namail.****.com" mailport="25" subject="Test build">
<from address="nobody@adobe.com"/>
<replyto address="nobody@adobe.com"/>
<to address="lolin@adobe.com"/>
<message>The nightly build has completed</message>
<attachments>
<fileset dir="${deploy.dir}">
<include name="**/*.zip"/>
</fileset>
</attachments>
</mail>
</target>