0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

GoでメールのFrom/Toをエンコードする一番簡単な方法

Posted at

Amazon SESを使ってメールを送信する際に、aws-sdk-goではFromに日本語名を使うと文字化けしてしまったので。

func main() {
	addr := mail.Address{
		Name:    "太田豊太郎",
		Address: "mail@example.com",
	}
	fmt.Println(addr.String()) // =?utf-8?q?=E5=A4=AA=E7=94=B0=E8=B1=8A=E5=A4=AA=E9=83=8E?= <mail@example.com>
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?