SmtpAddressValidatorIsValid(MailboxAddress) Method

Check whether a mailbox address is a valid SMTP address.

Definition

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

Parameters

mailbox  MailboxAddress
The mailbox address.

Return Value

Boolean
if the address is valid; otherwise, .

Remarks

Checks whether the Address of the mailbox is a valid SMTP address as defined by rfc5321. The display name and the route of the mailbox are not validated.

  Note

The address is validated exactly as it was parsed or set. An internationalized domain (such as grå.example.com) is reported as NonAscii. To validate the form of the address that would be used in an SMTP transaction that does not use the SMTPUTF8 extension, validate the string returned by GetAddress(Boolean) with a value of instead.

Exceptions

ArgumentNullException mailbox is .

See Also