我需要每天發送一封電子郵件(以HTML格式)與我的網頁中註冊的人員。我使用Grails插件「郵件」發送電子郵件。它發送沒有問題。但是,郵件發送時沒有回車,顯然這會導致郵件幾乎不可讀。這是代碼:在HTML中添加回車
ArrayList users=User.findAllByRegistradaBetween(date-1,date)
String results="\r\n"
for (int i=0;i<users.size();i++){
results = results+users[i].mail+"\r\n"
mailService.sendMail {
to '[email protected]'
from "[email protected]"
subject "A subject"
html '<label>Users registered today: '+results+'</label></br>'
}
我試過用\ r \ n,但沒有用,正如我懷疑的那樣,用HTML編寫。我怎樣才能得到類似的東西?:
等
謝謝!
與
試過嗎? – Serhiy或