SmtpAddressValidatorTryValidate(String, 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,
	out SmtpAddressError error
)

Parameters

address  String
The address.
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.

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

Exceptions

ArgumentNullException address is .

See Also