Verification in progress Differs from official docs Test scripts included

Syntax

IsEmailAddress(value)  →  boolean
1 argument — exactly

Parameters

Name Type Required Description
value string Yes Value to validate; trim it first, as a leading or trailing space fails

Example

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

Renders true.

The result works directly as a condition:

%%[
  IF IsEmailAddress("tomas.q@example.com") == true THEN
    SET @state = "matches-true"
  ELSE
    SET @state = "no-match"
  ENDIF
]%%
%%=v(@state)=%%

Renders matches-true.

Return value

boolean — true for an address that passes the syntax check, false otherwise.

Written into the email, the result is the lowercase word true or false. Compared with == true or == false in an IF, it behaves as a real boolean.

Behaviour

The result is lowercase. Every case rendered true or false, never the capitalised form.

A domain without a dot passes. IsEmailAddress("tomas.q@example") gives true.

A leading or trailing space fails. " tomas.q@example.com" and "tomas.q@example.com " both give false.

Local-part decoration is fine. A plus tag, dots, hyphens, underscores and digits are accepted: a.b-c_d+e9@x-y.z.example.museum gives true.

A number does not abort the call. IsEmailAddress(123) gives false, as does the empty string.

Which inputs are accepted

Call Renders
IsEmailAddress("tomas.q@example.com") true
IsEmailAddress("tomas.q+news@example.com") true
IsEmailAddress("tomas.q@mail.corp.example.com") true
IsEmailAddress("a.b-c_d+e9@x-y.z.example.museum") true
IsEmailAddress("tomas.q@example") true
IsEmailAddress("tomas.q.example.com") false
IsEmailAddress(" tomas.q@example.com") false
IsEmailAddress("tomas.q@example.com ") false
IsEmailAddress("a@b@example.com") false
IsEmailAddress("@example.com") false
IsEmailAddress("a@.com") false
IsEmailAddress("") false
IsEmailAddress(123) false

Calls with no argument or two arguments were not tested in Next.

Show Next test script
<!-- Marketing Cloud Next test script for IsEmailAddress. 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=[true] got=[%%=IsEmailAddress("tomas.q@example.com")=%%]</p>
<p>c2 expect=[false] got=[%%=IsEmailAddress("tomas.q.example.com")=%%]</p>
<p>c3 expect=[true] got=[%%=IsEmailAddress("tomas.q+news@example.com")=%%]</p>
<p>c4 expect=[false] got=[%%=IsEmailAddress("")=%%]</p>
<p>c5 expect=[matches-true] got=[%%[ IF IsEmailAddress("tomas.q@example.com") == true THEN SET @r2iet = "matches-true" ELSE SET @r2iet = "no-match" ENDIF ]%%%%=v(@r2iet)=%%]</p>
<p>c6 expect=[matches-false] got=[%%[ IF IsEmailAddress("tomas.q.example.com") == false THEN SET @r2ief = "matches-false" ELSE SET @r2ief = "no-match" ENDIF ]%%%%=v(@r2ief)=%%]</p>
<p>c7 expect=[true] got=[%%=IsEmailAddress("tomas.q@mail.corp.example.com")=%%]</p>
<p>c8 expect=[true] got=[%%=IsEmailAddress("tomas.q@example")=%%]</p>
<p>c9 expect=[false] got=[%%=IsEmailAddress(" tomas.q@example.com")=%%]</p>
<p>c10 expect=[false] got=[%%=IsEmailAddress("tomas.q@example.com ")=%%]</p>
<p>c11 expect=[true] got=[%%=IsEmailAddress("a.b-c_d+e9@x-y.z.example.museum")=%%]</p>
<p>c12 expect=[false] got=[%%=IsEmailAddress("a@b@example.com")=%%]</p>
<p>c13 expect=[false] got=[%%=IsEmailAddress("@example.com")=%%]</p>
<p>c14 expect=[false] got=[%%=IsEmailAddress("a@.com")=%%]</p>
<p>c15 expect=[false] got=[%%=IsEmailAddress(123)=%%]</p>

Differs from official docs

  • It works in Next although the docs say it does not. The official availability table marks IsEmailAddress as unsupported in Marketing Cloud Next. In a Next email it saved and rendered true or false, matching the result table of the official page. Card

Availability & differences

PlatformAvailable
Marketing Cloud EngagementYes
Marketing Cloud NextYes, from API 68.0

See also