Jenkins上使用發送郵件功能一直有問題,放棄Jenkins配置,使用ant的進行發送郵件,參考文檔能夠:html
https://www.jianshu.com/p/04cfce59890a測試
我這裏是要發送已經存在的html文件,因此關鍵是這句this
<loadfile property="email_content" srcFile="D:/jmeterDemo/demo/report/html/TestReport201903131016.html"/>
總體的bulid文件spa
<target name="sendEmail"> <echo>發送測試報告</echo> <loadfile property="email_content" srcFile="D:/jmeterDemo/demo/report/html/TestReport201903131016.html"/> <mail mailhost="XX.XX.com" user="XX@XX.com" password="XX!" subject="測試報告" mailport="25" messagemimetype="text/html" tolist="zhangjun1@XX.com" from="XX@XX.com"> <message> oh yes ,this is message----${email_content} </message> </mail> </target>
執行ant編譯code
報告爲:htm