---
schema_version: "1"
id: d1fedafc6cbd14ae14c8428300367039ea64872156d597593bfa13e36e050b88
title: Domain()
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud/ampscript/references/utilities/mc-ampscript-reference-utilities-domain.md
canonical_url: https://developer.salesforce.com/docs/marketing/marketing-cloud-ampscript/references/mc-ampscript-utilities/mc-ampscript-reference-utilities-domain.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: ff2c0d62065b7ed9872bba47424df6ece5edff00d9f8e2fd89380e5df8510ae6
products:
  - AMPscript for Marketing Cloud
  - Marketing Cloud
---
# Domain()

Returns the domain part of an email address. The domain part is the part of the email address that comes immediately after the at sign (@).

## Availability

<table>
  <tr>
    <td>Marketing Cloud Engagement</td>
    <td>✅ Yes</td>
  </tr>
  <tr>
    <td>Marketing Cloud Next</td>
    <td>✅ Yes</td>
  </tr>
</table>

## Syntax

```
Domain(emailAddress)
```

The `Domain()` function has one parameter:

- `emailAddress` (string): Required. An email address.

## Usage

This example returns the text after the @ sign (in this case, "example.com").

```
%%= Domain(sales@example.com) =%%
```

You can use this function with the `emailaddr` system personalization string. When you do, the function returns the email recipient's domain. For example, if you send a message to mary.smith@example.com, and the message body contains the AMPscript `%%=Domain(emailaddr)=%%`, Marketing Cloud Engagement replaces the AMPscript code with "example.com".

In some situations, the function returns `null`:

- If the parameter that you provide doesn't include an at sign.
- If the parameter is a non-string value.

This table shows some of the possible values that the function can return.

| Function                         | Result        |
| -------------------------------- | ------------- |
| Domain("salesforce@example.com") | example.com   |
| Domain("sales@force@example")    | force@example |
| Domain("salesforceexamplecom")   | `null`        |
| Domain(123)                      | `null`        |
