LoginSignup
1
1

More than 5 years have passed since last update.

SendGridでテキストメッセージ送信のタイプは(text/plain)を指定する。

Posted at

nodejsでnpm sendgridを使用し書いているときに、少しはまったのでメモ。

charsetをつけてtypeを指定すると、受信側の環境によっては、添付ファイルとして本文を受信してしまいます。Gmailなど。

var content = new helper.Content("text/plain: charset=UTF-8", '本文');

なので、次のようにテキストメッセージを送りたいだけの場合、text/plainと書けばOKです。

var content = new helper.Content("text/plain", '本文');

typeの指定は、text/plaintext/htmlを書くようにしたほうがよさそうです。
https://sendgrid.com/docs/API_Reference/Web_API_v3/Mail/index.html
charasetは場合に応じてつけても良いかもしれません。

1
1
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
1
1