Knowledge base

Custom headers

MailerSend Enterprise plan users can add unlimited custom headers to emails. This opens up new opportunities for personalization and advanced analytics.

What are custom headers?

Custom headers are additional pieces of information added to the header section of an email. These headers allow email senders to include unique identifiers, custom tracking codes, and other metadata that can be leveraged for detailed analytics, better email management, and enhanced personalization.

How to add custom headers

Adding custom headers in MailerSend can be accomplished through the API or SMTP settings. 

When sending an email via the MailerSend API, you can include custom headers by adding them to your POST request:

POST https://api.mailersend.com/v1/email
{
  ...
  "headers": [
    {
      "name": "X-Custom-Header",
      "value": "HeaderValue"
    }
  ],
  ...
}

Limitations

  • Custom headers must have a name and value, with names adhering to an alphanumeric format that can include hyphens

  • You will not be able to override default MailerSend headers

  • No spaces or invalid characters are allowed in header names