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
- How transactional emails work
- How to test email sending in MailerSend
- How to create automations
- How to add a custom unsubscribe header
- How to merge multiple SPF records
- How to verify an email list
- Rate limits: How to reduce 403, 422, & 429 errors
- How to whitelist IPs
- How to add a domain space to your account
- How to add a survey to your emails
- How to use the MailerSend iOS app
- How to request a dedicated IP
- SMS: How to handle opt-in and opt-out
-
Features
- Analytics
- Custom headers
- Domain tracking options
- Email tagging
- Email and recipient activity
- Ensuring secure SMS communication: Verification and usage limits
- File manager
- Inbound routing
- Managing API tokens
- REST API response codes
- Schedule bulk emails with the bulk endpoint
- Sender identities
- Sending domains
- SMTP relay
- Split Testing
- Templates
- Webhooks
- Upcoming changes to TLS Protocol support
- How to enable Google Email Actions & Highlights
- Deliverability
- Account settings
- Billing
- Integrations