Custom headers
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
List-Unsubscribe headers
You can add custom List-Unsubscribe headers with the list_unsubscribe parameter.
For the URL method:
POST https://api.mailersend.com/v1/email
{
...
"list_unsubscribe": "https://www.mailersend.com/unsubscribe",
...
}
For the mailto method:
POST https://api.mailersend.com/v1/email
{
...
"list_unsubscribe": "mailto:unsubscribe@mailersend.com",
...
}
For more information on List-Unsubscribe headers, including how they work and how to add them, visit our guide on how to add a custom unsubscribe header.
Need more info?
Feel free to reach out to support@mailersend.com. A member of our support team will gladly assist you.
- Getting started
- FAQ
-
Features
- Sending domains
- Managing API tokens
- Domain tracking options
- How to add a domain space to your account
- SMTP relay
- Webhooks
- Inbound routing
- Templates
- How to add a survey to your emails
- Email tagging
- File manager
- Email and recipient activity
- Analytics
- Split Testing
- How to use personalization in emails
- How to use the MailerSend iOS app
- Schedule bulk emails with the bulk endpoint
- Ensuring secure SMS communication: Verification and usage limits
- SMS: How to handle opt-in and opt-out
- Custom headers
- Upcoming changes to TLS Protocol support
- How to request a dedicated IP
- How to add a custom unsubscribe header
- Deliverability
- Account settings
- Billing
- Integrations