SmtpUtf8AddressValidatorIsValid(MailboxAddress, SmtpUtf8AddressValidationOptions) Method

Check whether a mailbox address is a valid SMTPUTF8 address.

Definition

Namespace: MimeKit.Utils
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public static bool IsValid(
	MailboxAddress mailbox,
	SmtpUtf8AddressValidationOptions options
)

Parameters

mailbox  MailboxAddress
The mailbox address.
options  SmtpUtf8AddressValidationOptions
The validation options.

Return Value

Boolean
if the address is valid; otherwise, .

Remarks

Checks whether the Address of the mailbox is a valid SMTPUTF8 address as defined by draft-ietf-mailmaint-smtputf8-syntax, using the specified options. The display name and the route of the mailbox are not validated.

  Note

The address is validated exactly as it was parsed or set, so an IDN-encoded domain (such as xn--gr-zia.example.com) is rejected with ALabel unless DecodeIdn is specified, in which case all of the code point, contextual and script rules are applied to the decoded domain.

Exceptions

ArgumentNullException mailbox is .

See Also