码迷,mamicode.com
首页 > 其他好文 > 详细

ant发邮件

时间:2015-06-17 19:57:23      阅读:163      评论:0      收藏:0      [点我收藏+]

标签:

1、首先,在环境中导入activation.jar和mail.jar,commons-email-1.2.jar。如果用eclipse中的ANT,步骤如下:

a) Window -> Preferences

b) Ant -> Runtime

c) Ant Home Entries -> “Add external JARs..."选择这几个jar包

d) apply and OK

2、示例build.xml

     

<target name="sendReport">

<loadfile property="report" srcFile="./test-output/html/overview.html" />
<mail mailhost="smtp.163.com" mailport="25" subject="Test Results Report" charset="utf-8" user="XXXXXX@163.com" password="XXXXXXXX" messageMimeType="text/plain">
<from address="XXXXXXX@163.com" />
<to address="XXXXXXX@163.com" />

<message>
Hi all,
This is Test Results Report,please view!
Thank you!

</message>
</mail>
</target>

ant发邮件

标签:

原文地址:http://www.cnblogs.com/louytu/p/4584159.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!