Skip to content

🐞 Issue: UTF-8 encoding failure in From.name and email headers (Node.js SendGrid SDK) #1457

@leonkwan46

Description

@leonkwan46

Summary

When using @sendgrid/mail in a Node.js (Firebase Functions) environment, UTF-8 characters in email headers such as From.name and Subject are not consistently preserved across email clients, especially iOS Mail.


Expected behavior

UTF-8 characters (e.g. è) in sender name and subject should be correctly encoded and displayed across all email clients.

Example:
From: Tonalè no-reply@domain.com
Subject: Tonalè Verification


Actual behavior

  • UTF-8 characters in From.name are displayed incorrectly (e.g. ? on iOS Mail)
  • Gmail may render correctly, but iOS Mail consistently fails
  • Subject and From headers appear to be encoded or downgraded incorrectly in transit
  • Branding characters (e.g. accented letters) are lost in headers

Technical setup

  • Node.js (Firebase Cloud Functions)
  • @sendgrid/mail SDK
  • Transactional emails (verification, password reset, email change)

Example:
from: { name: "Tonalè", email: "no-reply@domain.com" }


What was tested (no success)

  • Raw UTF-8 strings in from.name
  • RFC 2047 encoding (=UTF-8 base64 style encoding)
  • Base64 encoding via Node.js Buffer
  • Latin-1 / ISO-8859-1 pre-encoding
  • HTML body encoding (works correctly — only headers are affected)

Key observation

SendGrid appears to:

  • Normalize or re-encode MIME headers internally
  • Potentially downgrade encoding to non-UTF-8 (7-bit / ISO-8859-1)
  • Result in corrupted display of non-ASCII characters in strict email clients (notably iOS Mail)

Impact

  • Inconsistent branding in email sender name
  • Broken display of accented characters in Apple Mail / iOS Mail
  • Cannot reliably use non-ASCII characters in email headers

Request

Could you confirm:

  • Whether UTF-8 is fully supported in From.name and Subject via the Node.js SDK
  • Whether SendGrid performs internal header normalization or re-encoding
  • Recommended best practice for ensuring consistent rendering across all major email clients (especially iOS Mail)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions