ANT发送邮件需要的3个JAR包:activation.jar、mail.jar、commons-email-1.2.jar

将这三个jar包放到 $ANT_HOME/LIB 路径下即可

内网发送邮件:

<target name="sendEmail">
		<mail mailhost="internalmail.test.com" mailport="25" subject="SmokeTest Report!" messagefile="${JMeter.home}/extras/AutoTestReport${time}_failure.html" messagemimetype="text/html" tolist="${to_me_only}">
			<from address="mim.zhang@test.com"/>
			<fileset dir="${JMeter.home}/extras/">
				<!-- <include name="AutoTestReport${time}.html"/> -->
				<include name="expand.png"/>
			</fileset>
			<!-- <message>This email was sent automatically by ANT. <br />
			Please check the automation test report by the link below.  <br />
			If there are any questions, please contact with mim. Thank you! <br /><br />
			http://SZCOMPUTER/AutoTestReport${time}.html
			</message> -->
		</mail>
</target>

 外网发送邮件

<target name="sendEmail">
		<mail mailhost="stmp.qq.com" mailport="25" from="12345678@qq.com" user="12345678" password="*****" subject="SmokeTest Report!" messagefile="${JMeter.home}/extras/AutoTestReport${time}_failure.html" messagemimetype="text/html" tolist="${to_me_only}">
			<fileset dir="${JMeter.home}/extras/">
				<!-- <include name="AutoTestReport${time}.html"/> -->
				<include name="expand.png"/>
			</fileset>
			<!-- <message>This email was sent automatically by ANT. <br />
			Please check the automation test report by the link below.  <br />
			If there are any questions, please contact with mim Zhang. Thank you! <br /><br />
			http://SZCOMPUTER/AutoTestReport${time}.html
			</message> -->
		</mail>
</target>

 

相关文章:

  • 2021-10-21
  • 2021-12-13
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-10-17
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-01
  • 2021-08-26
  • 2022-12-23
  • 2021-09-01
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案