SmtpAddressValidatorTryValidate(String, SmtpAddressValidationOptions, SmtpAddressError) Method

Validate an address as an SMTP address.

Definition

Namespace: MimeKit.Utils
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public static bool TryValidate(
	string address,
	SmtpAddressValidationOptions options,
	out SmtpAddressError error
)

Parameters

address  String
The address.
options  SmtpAddressValidationOptions
The validation options.
error  SmtpAddressError
The reason that the address is invalid or None if it is valid.

Return Value

Boolean
if the address is valid; otherwise, .

Remarks

Validates an addr-spec (such as user@example.com) as an SMTP address as defined by rfc5321, using the specified options.

The address must not include a display name, angle brackets, comments, or folding whitespace.

Exceptions

ArgumentNullException address is .

See Also