如何使用ant发送邮件?

sac*_*hin 2 ant

如何使用ant将邮件发送给相应的用户.

我正在使用ant执行一些测试,需要告知用户所执行测试的状态.那么有什么方法可以实现这个目标吗?

问候:萨钦

use*_*320 5

使用SMTP邮件任务.

http://ant.apache.org/manual/Tasks/mail.html

例:

<mail mailhost="smtp.myisp.com" mailport="1025" subject="Test build">
  <from address="config@myisp.com"/>
  <replyto address="me@myisp.com"/>
  <to address="all@xyz.com"/>
  <message>The ${buildname} nightly build has completed</message>
  <attachments>
    <fileset dir="dist">
      <include name="**/*.zip"/>
    </fileset>
  </attachments>
</mail>
Run Code Online (Sandbox Code Playgroud)