Email special headers

November 20, 2024 · Updated on April 10, 2025

Ever wonder how some emails magically include an “Unsubscribe” button at the top or how your inbox neatly categorizes messages from the same sender? That’s thanks to special email headers!

Unsubscribe Headers

Modern email services like Gmail and Outlook use List-Unsubscribe headers to let users opt out with a single click. Instead of digging through the email for a tiny “unsubscribe” link, you get a clear button at the top. This improves deliverability for senders and makes it easier for users to manage subscriptions.

Email Grouping Headers

To prevent inbox clutter, email providers use headers like List-ID and Precedence to group related emails together. For example:

List-ID: Helps categorize newsletters from the same source.

Precedence: Bulk: Tells the email provider it’s part of a mass mailing, which can influence filtering.

Example 1

	const info = await transporter.sendMail({
		from: '"My Newsletter" <[email protected]>',
		to: '[email protected]',
		subject: 'Your Weekly Update',
		text: 'Here is your update!',
		html: '<p>Here is your update!</p>',
 
		// Special headers
		headers: {
			'List-Unsubscribe': '<mailto:[email protected]>, <https://yourdomain.com/unsubscribe>',
			'List-ID': 'weekly-updates.yourdomain.com',
			Precedence: 'bulk',
		},
	});

When a recipient clicks the unsubscribe link, an unsubscribe request will be emailed to the email address you've provided.

Example 2

	const info = await transporter.sendMail({
		from: '"My Newsletter" <[email protected]>',
		to: '[email protected]',
		subject: 'Your Weekly Update',
		text: 'Here is your update!',
		html: '<p>Here is your update!</p>',
 
		// Special headers
		headers: {
			'List-Unsubscribe': '<https://yourdomain.com/unsubscribe>',
			'List-ID': 'weekly-updates.yourdomain.com',
			Precedence: 'bulk',
		},
	});

When a recipient clicks the unsubscribe link, the user will be redirected to the provided URL where the rest of the flow will continue.

By using these headers correctly, email senders improve engagement, while users get a cleaner, more manageable inbox.

Want to improve your email campaigns? Make sure you’re using these headers the right way!