日期:2014-05-18  浏览次数:20676 次

html文件的邮件内容(动态获取的数据),如何才能换行显示?
1.  .html文件(邮件内容) 
<table width="100%" border="0" cellspacing="5" cellpadding="5">
                <tr>
                  <td width="16%">#author#</td>
                  <td width="84%">#lastUpdate#</td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                  <td>#remarks#</td>     //1.remark变量,表示“留言内容”  2.在邮件里面,留言内容是不换行的?——remark是SalesOrderComment.java的属性,留言的时候,也用了回车键,而且在.jsp页面里面显示的时候,remark留言内容是换行的……只是在邮件里面,为什么它就没有换行?
                </tr>
              </table>



2.  .java文件 
final SalesOrderComment model; 


// 
static final SimpleDateFormat SDF = new SimpleDateFormat("MMM dd, yyyy"); 

public String build(String content, String serverName) throws Exception { 
content = content 
.replace("#uid#", account.getUsername()) 
.replace("#contact#", var.getLinkman()) 
.replace("#orderNo#", varSO.orderNo) 
.replace("#ordId#", String.valueOf(varSO.ordId)) 
.replace("#orderDate#", SDF.format(varSO.orderDate)) 
.replace("#qty#", String.valueOf(varSO.qty)) 
.replace( 
"#netAmount#", 
var.getCurr().symbol 
+ String.valueOf(varSO.netAmount)) 
.replace("#amount#", 
var.getCurr().symbol + String.valueOf(varSO.amount)) 
.replace("#shipMethod#", varSO.shipMethod) 
.replace("#realDeliDate#", SDF.format(varSO.realDeliDate)) 
.replace("#enHtml#", varSO.status.enHtml) 
.replace("#author#", model.author) 
.replace("#lastUpdate#", SDF.format(model.lastUpdate)) 
.replace("#remarks#", model.remarks) 
.replace("#host#", serverName);