Mailbox AddressGet Domain Method
Get the domain of the email address, either IDN-encoded or decoded.
Definition
Namespace: MimeKit
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
The domain portion of the mailbox address.
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public string GetDomain(
bool idnEncode
)Parameters
- idnEncode Boolean
- if the domain should be encoded according to IDN encoding rules; otherwise, to decode it.
Return Value
StringThe domain portion of the mailbox address.
Remarks
If idnEncode is , then each internationalized label of the domain is encoded as an A-label (e.g. xn--bcher-kva.example). Otherwise, each A-label is decoded into its Unicode form (e.g. bücher.example).
Domain literals (e.g. [127.0.0.1]) are always returned as-is.