Class EmailHelper
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).
Inherited Members
Namespace: SecureExchangesSDK.Helpers
Assembly: SecureExchangesSDK.dll
Syntax
public static class EmailHelper
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.
Declaration
public static bool IsValidEmailAddress(string emailAddress, bool ignoreDisposableDomains = false, bool ignoreSEReservedDomains = true)
Parameters
| Type | Name | Description |
|---|---|---|
| string | emailAddress | The email address to be validated. |
| bool | ignoreDisposableDomains | Indicates whether to ignore disposable domains during validation. |
| bool | ignoreSEReservedDomains | Indicates whether to ignore SE reserved domains during validation. |
Returns
| Type | Description |
|---|---|
| bool | True if the email address is valid, False otherwise. |