Verification in progress Differs from official docs Test scripts included

Syntax

Domain(emailAddress)  →  string
1 argument — exactly

Parameters

Name Type Required Description
emailAddress string Yes Email address; the text after the first at sign is returned verbatim

Example

%%=Domain("tomas.q@example.com")=%%

Renders example.com.

The casing of the address is kept, so fold it before comparing against a list of domains:

%%=Lowercase(Domain("Tomas.Q@Example.COM"))=%%

Renders example.com.

Return value

string — the text after the first at sign, unchanged.

The result is open text. Inputs without a usable domain part render nothing at all, so test the result for emptiness rather than comparing it with a literal.

Behaviour

The split happens at the first at sign. Domain("a@b@example.com") gives b@example.com: the second at sign stays in the result.

Multi-level domains come back whole. Domain("tomas.q@a.b.example.co.uk") gives a.b.example.co.uk, and the six-label Domain("tomas.q@sub.a.b.example.co.uk") also keeps every label (sub.a.b.example.co.uk).

Casing is preserved. Domain("Tomas.Q@Example.COM") gives Example.COM.

The address is not validated. Domain("tomas q@example.com") gives example.com despite the space, and Domain("hello@world") gives world.

A plus tag makes no difference. Domain("tomas.q+news@example.com") gives example.com.

What comes back for each shape

Call Renders
Domain("tomas.q@example.com") example.com
Domain("tomas.q+news@example.com") example.com
Domain("tomas.q@a.b.example.co.uk") a.b.example.co.uk
Domain("a@b@example.com") b@example.com
Domain("Tomas.Q@Example.COM") Example.COM
Domain("hello@world") world
Domain("example.com") (empty)
Domain("tomas.q@") (empty)
Domain("@") (empty)
Domain("") (empty)
Domain(123) (empty)

A call with the wrong number of arguments was not tried in Next.

Show Next test script
<!-- Marketing Cloud Next test script for Domain. Paste it into the HTML component of a
     Next email and open the preview. Each line prints the result Next gave when the call
     was rendered on its own (expect) next to the result of this run (got).
     Assembled from single-call test emails (dates on the page); it has not been
     run as one email. Calls that make Next fail are listed separately. -->
<p>c1 expect=[example.com] got=[%%=Domain("user@example.com")=%%]</p>
<p>c2 expect=[a.b.example.co.uk] got=[%%=Domain("tomas.q@a.b.example.co.uk")=%%]</p>
<p>c3 expect=[Example.COM] got=[%%=Domain("Tomas.Q@Example.COM")=%%]</p>
<p>c4 expect=[b@example.com] got=[%%=Domain("a@b@example.com")=%%]</p>
<p>c5 expect=[sub.a.b.example.co.uk] got=[%%=Domain("tomas.q@sub.a.b.example.co.uk")=%%]</p>
<p>c6 expect=[] got=[%%=Domain("example.com")=%%]</p>
<p>c7 expect=[] got=[%%=Domain("")=%%]</p>
<p>c8 expect=[world] got=[%%=Domain("hello@world")=%%]</p>
<p>c9 expect=[example.com] got=[%%=Domain("tomas.q+news@example.com")=%%]</p>
<p>c10 expect=[example.com] got=[%%=Domain("tomas q@example.com")=%%]</p>
<p>c11 expect=[] got=[%%=Domain("tomas.q@")=%%]</p>
<p>c12 expect=[] got=[%%=Domain("@")=%%]</p>
<p>c13 expect=[] got=[%%=Domain(123)=%%]</p>

Differs from official docs

  • It works in Next although the docs say it does not. The official availability table marks Domain as unsupported in Marketing Cloud Next. In a Next email it saved and rendered, for example example.com for a plain address. Card

Availability & differences

PlatformAvailable
Marketing Cloud EngagementYes
Marketing Cloud NextYes, from API 68.0
Same in Marketing Cloud Engagement

Every address shape tried renders the same in Engagement, from example.com for a plain address to an empty result for a string without an at sign. Compared 2026-11-23 by rendering the same calls in a Marketing Cloud Next email.

See also