The OpenD Programming Language

isEmail

Check that an email address conforms to RFCs 5321, 5322 and others.

Distinguishes between a Mailbox as defined by RFC 5321 and an addr-spec as defined by RFC 5322. Depending on the context, either can be regarded as a valid email address.

Note: The DNS check is currently not implemented.

isEmail
(
Char
)
if (
isSomeChar!(Char)
)

Parameters

email const(Char)[]

The email address to check

checkDNS CheckDns

If Yes.checkDns then a DNS check for MX records will be made

errorLevel EmailStatusCode

Determines the boundary between valid and invalid addresses. Status codes above this number will be returned as-is, status codes below will be returned as EmailStatusCode.valid. Thus the calling program can simply look for EmailStatusCode.valid if it is only interested in whether an address is valid or not. The errorLevel will determine how "picky" isEmail() is about the address.

If omitted or passed as EmailStatusCode.none then isEmail() will not perform any finer grained error checking and an address is either considered valid or not. Email status code will either be EmailStatusCode.valid or EmailStatusCode.error.

Return Value

An EmailStatus, indicating the status of the email address.

Meta