New in Chargebee: Explore Reveal and understand your payment performance end-to-end.Try Now
Docschargebee docs
HomeBillingPaymentsRevRecGrowthReveal
Support

Product Updates


  • Release Notes

Getting Started


  • Overview
  • Chargebee Billing Data Centers
  • Object Relationship Model
  • Understanding Sites
  • Chargebee Tech Glossary
  • Articles and FAQ

Implementing Chargebee


  • Implementation Guide
  • Go-live Checklist
  • Articles and FAQ

AI in Chargebee


  • Chargebee Copilot
  • Chargebee MCP Server (Model Context Protocol)

Developer Resources


  • Developer Resources Overview
  • Articles and FAQ

Product Catalog


  • Product Catalog Overview
  • Coupons
  • Articles and FAQ

Subscriptions


  • Working with Subscriptions
  • Billing
  • Orders
  • Articles and FAQ

Customers


  • Managing Customers
  • Account Hierarchy
  • Email Notifications
    • Email logs
    • SMTP Configuration
      • Basic Authentication
      • OAuth Authentication
      • Custom Headers
    • Mail Merge Usage
    • Sending Manual Emails
    • DMARC Regulation
    • Domain Authentication
  • Branding
  • Configure Multiple Languages
  • Articles and FAQ

Entitlements


  • Entitlements Overview
  • Features Overview
  • Feature Management
  • Managing Product Entitlements
  • Subscription Entitlements
  • Customer Entitlements
  • Grandfathering Entitlements
  • Articles and FAQ

Usage Based Billing


  • Understanding Usages
  • Setting up Usage Based Billing
  • Usage Alerts
  • Metered Billing
  • Articles and FAQ

Chargebee CPQ


  • Chargebee CPQ
  • Chargebee CPQ for Salesforce
  • Chargebee CPQ for HubSpot

Invoices, Credit Notes, and Quotes


  • Invoices
  • Credit Notes
  • Quotes [Legacy]
  • Transactions
  • Articles and FAQ

Taxes


  • Overview
  • Configuring Taxes
  • Country-specific Taxes
  • Articles and FAQ

Hosted Capabilities


  • Overview
  • Hosted Checkout
  • Hosted Self-Serve Portal
  • Hosted Pages Features
  • Additional Hosted Pages
  • Payment Components
  • Pricing Table
  • Managing Payments with Chargebee.js
  • Mobile-Optimized Hosted Pages
  • Articles and FAQ

Site Configuration


  • Users & Roles
  • Custom Fields & Metadata
  • Approvals
  • Mandatory Fields
  • File Attachments & Comments
  • Advanced Filter Options
  • Multicurrency Pricing
  • Multi-decimal Support
  • Configuring Reason Codes
  • Events and Webhooks
  • API Keys
  • Time Zone
  • Time Machine
  • Transfer Configurations
  • Articles and FAQ

Multi Business Entity


  • Multi Business Entity Overview
  • Customer Transfer Overview
  • Articles and FAQ

Mobile Subscriptions


  • Overview
  • Omnichannel Subscriptions
  • Omnichannel One-Time Orders
  • Mobile Subscriptions (Legacy)

Reports and Analytics


  • RevenueStory
  • Home Dashboard
  • Frequently Asked Questions
  • FAQs for Classic Reports Sunset
  • Articles and FAQ

Integrations


  • Sales
  • Customer Support and Success
  • Finance
  • Tax
  • eInvoicing
  • Marketing
  • Stitch
  • Collaboration
  • Contract Management
  • Ecommerce Management
  • Articles and FAQ

Data Privacy & Security


  • Two Factor Authentication
  • SAML Single Sign-On
  • System for Cross-Domain Identity Management (SCIM)
  • EU-GDPR
  • Consent Management
  • Personal Data Management
  • Compliance Certificates
  • HIPAA Guidelines
  • PCI Recommendations and Integration Types
  • Articles and FAQ

Data Operations


  • Bulk Operations
  • Migration
  • Articles and FAQ
  1. Billing
  2. Customers
  3. Email Notifications
  4. SMTP Configuration
  5. Custom Headers
  1. Billing
  2. Customers
  3. Email Notifications
  4. SMTP Configuration
  5. Custom Headers

Custom SMTP Headers

Custom SMTP headers let you attach additional metadata to every outbound email notification sent from Chargebee. These headers are useful for tracking, filtering, routing, and integrating with downstream email analytics systems.

Note

Custom headers are applied to all outbound email notifications, whether sent through Chargebee's built-in SMTP server or your own SMTP server.

Use Cases

Custom headers are commonly used for:

  • Email tracking and analytics: Tag emails with campaign or category identifiers so your analytics platform can group and report on them (e.g., X-Email-Category: dunning).
  • Routing and filtering: Add metadata that your email gateway or inbox rules can act on (e.g., X-Priority-Level: high).
  • Compliance and audit: Stamp emails with internal identifiers for audit trails (e.g., X-Audit-Ref: inv-20260423).
  • Downstream integrations: Pass context to third-party systems such as CRMs or ticketing tools that parse inbound email headers.

Prerequisites

Before configuring custom SMTP headers, ensure you have:

  • Admin or equivalent permissions in Chargebee (Configure Chargebee role)

Configuring Custom Headers

Step 1: Navigate to SMTP Settings

  1. Go to Settings > Configure Chargebee > Email Notifications
  2. Scroll down to the Custom SMTP Headers section below your SMTP configuration
  3. Click on Configure Custom Headers
Custom SMTP Headers section in Email Notification settings

Step 2: Add Headers

Each header is a name-value pair. To add a header:

  1. Enter the Header Name — must start with the X- prefix (e.g., X-Campaign-ID)
  2. Enter the Header Value — the value that will be included in every outbound email (e.g., chargebee-billing)
  3. Click Add header to add more rows (up to the maximum allowed)
  4. Click Confirm to persist your headers
Adding custom SMTP header name-value pairs

Note

Header names are case-insensitive. For example, X-Campaign-ID and x-campaign-id are treated as the same header. Chargebee stores all header names in lowercase.

A success notification confirms that the headers have been saved.

Custom headers saved successfully

Step 3: Verify Headers

After saving, you can verify that your custom headers are being applied by:

  1. Triggering a test email notification from Chargebee
  2. Inspecting the email headers in your email client (most clients have a "View original" or "Show headers" option)
  3. Confirming that the custom headers appear in the raw email source

Header Rules and Limits

Custom headers are validated against the following rules:

RuleLimitDetails
Maximum headers5You can configure up to 5 custom headers per site
Name prefixX-All header names must begin with the X- prefix
Name length64 charactersMaximum length for a header name
Value length512 charactersMaximum length for a header value
Total payload size8 KBCombined size of all header names and values cannot exceed 8 KB
Allowed characters (name)Alphanumeric and hyphensHeader names may only contain A-Z, a-z, 0-9, and -
DuplicatesNot allowedEach header name must be unique (case-insensitive)

Reserved Headers

Certain headers are reserved and cannot be used as custom header names. These include:

  • Standard email headers: From, To, CC, BCC, Subject, Date, Message-ID, Reply-To, Return-Path, MIME-Version, Content-Type, Content-Transfer-Encoding, Content-Disposition
  • Trace and routing headers: Received, X-Received, Delivered-To, X-Forwarded-To, X-Forwarded-For, X-Originating-IP
  • Authentication headers: DKIM-Signature, Authentication-Results, Received-SPF, ARC-Seal, ARC-Message-Signature, ARC-Authentication-Results
  • Client and priority headers: X-Mailer, X-Priority
  • Provider-specific headers: X-SMTPAPI (SendGrid), X-Mailgun-Tag, X-Mailgun-Variables, X-Mailgun-Track-Opens, X-Mailgun-SID, X-Mailgun-Sending-IP, X-MC-Tags (Mandrill), X-Mailjet-Campaign
  • Chargebee internal headers: Any header starting with X-Chargebee (including X-Chargebee-*)
  • Resent headers: Any header starting with Resent (e.g., Resent-From, Resent-To)

Warning

If a custom header name conflicts with a header that your SMTP provider already sets on the email, the provider's header takes precedence and the custom header will be skipped for that email. This prevents accidental overrides of provider-managed metadata.

Managing Custom Headers

Editing Headers

To update an existing header:

  1. Modify the Header Name or Header Value in the respective field
  2. Click Confirm to apply the changes

Changes take effect for all emails sent after saving.

Removing Headers

To remove a header:

  1. Click the trash icon next to the header row you want to remove
  2. Click Confirm to persist the change
Removing a custom SMTP header row

Note

At least one empty row is always shown in the form. If you want to remove all custom headers, clear the name and value fields and save — this deletes all stored headers.

Validation Errors

Chargebee validates each header when you save. If any header fails validation, the specific error is displayed inline below the affected field.

Inline validation error displayed below the header field

Common validation errors include:

ErrorCauseResolution
Header name must start with the X- prefixThe header name does not begin with X-Rename the header to start with X- (e.g., X-My-Header)
Header name contains invalid charactersThe name includes characters other than letters, digits, or hyphensRemove special characters; use only A-Z, 0-9, and -
Header is reservedThe header name matches a reserved or provider-specific headerChoose a different header name
Duplicate header names are not allowedTwo or more headers have the same name (case-insensitive)Rename or remove the duplicate
Header name/value exceeds allowed lengthThe name or value is too longShorten the name (max 64 chars) or value (max 512 chars)
Total header size exceeds the 8 KB limitThe combined size of all headers is too largeShorten header values or remove some headers
Header name/value is requiredA row has a name but no value, or a value but no nameFill in both fields or remove the incomplete row

How It Works

When custom SMTP headers are configured:

  1. On save: Headers are validated against naming rules, length limits, and the reserved list. Valid headers are stored with normalized (lowercased) names.
  2. On email send: When Chargebee sends an email notification, the stored custom headers are read and appended to the email's MIME headers before delivery.
  3. Conflict resolution: If a custom header name matches a header already present on the email (set by the email provider or Chargebee), the custom header is skipped for that email to prevent conflicts.

Frequently Asked Questions (FAQs)

1. Are custom headers applied to emails sent through Chargebee's default SMTP server?

Yes. Custom headers are applied to all outbound email notifications, regardless of whether you use Chargebee's built-in SMTP server or your own.

2. Can I use custom headers to override standard email headers like From or Reply-To?

No. Standard email headers and provider-specific headers are reserved and cannot be overridden. Custom headers must use the X- prefix and cannot conflict with reserved names.

3. When do header changes take effect?

Changes take effect immediately for all emails sent after the save action. There is no delay or propagation period.

4. Can I set different headers for different notification types?

No. Custom SMTP headers are applied uniformly to all outbound email notifications. They cannot be configured per notification type or per customer.

5. Do custom headers affect email deliverability?

Custom X- headers generally do not affect deliverability. However, adding excessively large or numerous headers could impact email size. Stay within the recommended limits to avoid issues.

6. How do I check if my custom headers are being applied?

Send a test email and inspect its raw headers. In most email clients, you can view the original message source to see all MIME headers, including your custom ones.

7. Why is my header name being converted to lowercase?

Email header names are case-insensitive per RFC 2616. Chargebee normalizes all header names to lowercase for consistent storage and duplicate detection. The email standard ensures that recipients treat X-Campaign-ID and x-campaign-id identically.

Related Articles

  • SMTP Configuration Overview - Overview of SMTP options
  • Basic Authentication - Configure username/password SMTP
  • OAuth Authentication - Configure OAuth for Microsoft 365 and Google
  • Email Notifications - Learn about email notification types
  • Email Logs - Monitor your email delivery

Articles & FAQs

What is an SMTP server?
When would I use my own SMTP Server instead of Chargebee's?
What happens when the SMTP server is down?

Was this article helpful?