带有html内容的邮件显示换行符或忽略换行符

I am sending mail to users via mandrill and I using both smtp and mandrill api to send. Content of the mail is rendered go template (.tpl) When I put template like

Hi {{.name}},
<br/>
This is support.  
<br/>

it sends via mandrill api ok, but
is visible when I send via smtp, when use template like ( <br/> replaced with )

Hi {{.name}},

This is support.  

mandrill ignores that and shows everything in one line but smtp shows ok newlines. What is a solution for this ?

I am rendering template like

frame, err := template.New("foo").Parse( *templateString )
if err != nil {
    return nil, err
}
var doc bytes.Buffer
frame.Execute( &doc, *parameters )
temp := doc.String()
查看全部
duan4369
duan4369
2015/06/22 09:25
  • templates
  • mandrill
  • email
  • 点赞
  • 收藏
  • 回答
    私信
满意答案
查看全部

1个回复