Table of Contents

Class EmailHelper

Namespace
SecureExchangesSDK.Helpers
Assembly
SecureExchangesSDK.NetCore.dll

Provides functionality to validate email addresses. This includes methods to create a regular expression for validating the format of email addresses, and methods to determine if a given email address is valid according to the regular expression and additional criteria (e.g., not belonging to specific domains).

public static class EmailHelper
Inheritance
EmailHelper
Inherited Members

Methods

IsValidEmailAddress(string, bool, bool)

Validates an email address. The email is considered valid if it is not null or empty, matches the pattern defined in the regular expression, and does not belong to a list of disposable or SE reserved email domains. This method combines all checks into a single return statement for efficiency.

public static bool IsValidEmailAddress(string emailAddress, bool ignoreDisposableDomains = false, bool ignoreSEReservedDomains = true)

Parameters

emailAddress string

The email address to be validated.

ignoreDisposableDomains bool

Indicates whether to ignore disposable domains during validation.

ignoreSEReservedDomains bool

Indicates whether to ignore SE reserved domains during validation.

Returns

bool

True if the email address is valid, False otherwise.