0
我正在使用Ant郵件任務發送構建狀態的電子郵件。如何在HTML正文部分使用Ant郵件以純文本形式發送郵件任務
<target name="htmllink">
<exec executable="svn" outputproperty="**svnlog**">
<arg line="log -r ${bottom_rev}:${top_rev} -v svn://172.16.143.200/Repository/branches/${project.svn.url}/${build_tech} --username ${svn.username} --password ${svn.username}" />
</exec>
<mail from="[email protected]"
messagemimetype="text/html"
tolist="[email protected]"
cclist="[email protected]"
bcclist="[email protected]"
subject="BUILD SCRIPT AUTOMATED MAIL FOR ${patch.name}"
mailhost="172.16.143.41"
charset="ISO-8859-1"> <!-- local SMTP mailhost IP -->
<message src="OC.html" />
</mail>
</target>`
here i am using OC.html message source page for mailing contents like below
`<html>
<head>
<STYLE TYPE="text/css">
td{font-family: Calibri; font-size: 12pt;}
.color {color:black;font-size:10pt;display : block;line-height:16px; text-align : center;background-color:#D4AEBB; border:outset 3px #DB7093;text-decoration:none;width:50%;}
.color:HOVER {color:red;font-size:10pt;display : block; line-height:16px;text-align : center;background-color : #F0DEE5; border :inset 3px #CC3366;text-decoration:none;width:50%;}
</STYLE>
</head>
<body onload="wrapLines(30, ${svnlog})">
<a class="color" href="http://172.16.170.113/dashboard/Patch_details.aspx?patch_name=${patch.name}&branch_name=${project.svn.url}" rel="Does not exist">BDT Report</a></br>
BR#${BR.number}</br>
The build is completed and available at FTP site.</br>
</br>
Objective-C patch</br>
*******************************************************************************</br>
Patch Name : ${patch.name}</br>
Revision Number : ${bottom_rev} to ${top_rev}</br>
FTP Location : ${ftp.location}/${patch.name}.tar.gz</br>
*******************************************************************************</br>
SVN Log Info</br>
************</br>
**${svnlog}**</br></br>
</body>
</html>
在正文部分,我正在打印螞蟻變量$ {svnlog},它是一堆代碼簽入說明行。所以在這裏它將所有的行都打印在一條長線上,而不是在單獨的線上。
我怎樣才能得到這在單獨的單行?
所以解決方案是將它包裝在pre? – oers 2012-05-04 11:06:02
是的,你必須包裹身體部分
– picnic4u 2012-05-07 06:16:38