This seems like a very common need, but I didn't find any good guides when I searched for it.
3条回答 默认 最新
- dongwei3172 2012-03-30 23:16关注
Assuming that you're using the net/smtp package and so the smtp.SendMail function, you just need to declare the MIME type in your message.
mime := "MIME-version: 1.0; Content-Type: text/html; charset=\"UTF-8\"; "; subject := "Subject: Test email from Go! " msg := []byte(subject + mime + "<html><body><h1>Hello World!</h1></body></html>") smtp.SendMail(server, auth, from, to, msg)
Hope this helps =)
解决 无用评论 打赏 举报
悬赏问题
- ¥15 fluent的在模拟压强时使用希望得到一些建议
- ¥15 STM32驱动继电器
- ¥15 Windows server update services
- ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
- ¥15 模糊pid与pid仿真结果几乎一样
- ¥15 java的GUI的运用
- ¥15 Web.config连不上数据库
- ¥15 我想付费需要AKM公司DSP开发资料及相关开发。
- ¥15 怎么配置广告联盟瀑布流
- ¥15 Rstudio 保存代码闪退