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 (@).

The Domain() function has one parameter:

  • emailAddress (string): Required. An email address.

This example returns the text after the @ sign (in this case, "").

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, and the message body contains the AMPscript %%=Domain(emailaddr)=%%, Marketing Cloud Engagement replaces the AMPscript code with "".

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.