---
schema_version: "1"
id: 38f8159337a384ade61181fcf24b249254709c701b53269cba1d90abe908a637
title: Add Unsubscribe Headers to Email for Mailing List Compliance
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/commerce/264-0-0/b2c_rn_25_10_email_unsubscribe_headers.md
canonical_url: https://help.salesforce.com/s/articleView?id=commerce.b2c_rn_25_10_email_unsubscribe_headers.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 309ac25596f4d4bccce21c15641682d9fef4352b7ce571a201461e37e2ac87bc
description: Add List-Unsubscribe and List-Unsubscribe-Post headers to emails sent using the dw.net.Mail class to support compliance with email provider guidelines, including Google Sender Guidelines. Use the new setListUnsubscribe and setListUnsubscribePost methods to integrate with externally-managed mailing lists and enable one-click unsubscribe functionality.
products:
  - Commerce
  - B2C Commerce
release: "264"
---
# Add Unsubscribe Headers to Email for Mailing List Compliance

Add List-Unsubscribe and List-Unsubscribe-Post headers to emails sent using the dw.net.Mail class to support compliance with email provider guidelines, including Google Sender Guidelines. Use the new setListUnsubscribe and setListUnsubscribePost methods to integrate with externally-managed mailing lists and enable one-click unsubscribe functionality.

The `dw.net.Mail` class now includes two new methods:

- `setListUnsubscribe(String)` - Sets the List-Unsubscribe header value to work with List-Unsubscribe-Post to allow integration with an externally-managed mailing list
- `setListUnsubscribePost(String)` - Sets the List-Unsubscribe-Post header value to support one-click unsubscribe functionality

Both methods return the Mail object to support method chaining. These headers help comply with email provider requirements, including [Google Sender Guidelines](https://support.google.com/a/answer/81126?hl=en).

**Where:** This feature applies to B2C Commerce.

**How:** Use the new methods in your scripts when creating email with the `dw.net.Mail` class. For example:

```
mail.setListUnsubscribe("<https://example.com/unsubscribe>");
mail.setListUnsubscribePost("List-Unsubscribe=One-Click");
```

#### See Also

- [Class Mail](https://salesforcecommercecloud.github.io/b2c-dev-doc/docs/upcoming/scriptapi/html/api/class_dw_net_Mail.html)