Smtp Address ValidatorTry Validate(Mailbox Address, Smtp Address Validation Options, Smtp Address Error) Method
Validate a mailbox address as an SMTP address.
Definition
Namespace: MimeKit.Utils
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
if the address is valid; otherwise, .
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public static bool TryValidate(
MailboxAddress mailbox,
SmtpAddressValidationOptions options,
out SmtpAddressError error
)Parameters
- mailbox MailboxAddress
- The mailbox address.
- options SmtpAddressValidationOptions
- The validation options.
- error SmtpAddressError
- The reason that the address is invalid or None if it is valid.
Return Value
Booleanif the address is valid; otherwise, .
Remarks
Validates the Address of the mailbox as an SMTP address as defined by rfc5321, using the specified options. The display name and the route of the mailbox are not validated.
Exceptions
| ArgumentNullException | mailbox is . |