EmailAddressToIdnAddress Method
Gets a new EmailAddress object which is a copy of the current object with the domain part converted into IDN format.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
public EmailAddress ToIdnAddress()

Return Value

Type: EmailAddress
A reference to newly created EmailAddress which is a copy of the current object with the domain part converted into Punycode.

If you have an e-mail address which may potentially have international characters in the domain part, you should call this method to make this address safe for SMTP servers and use the resulting object instead of the original EmailAddress object.

It's safe to use this method for addresses which don't contain any international characters, you'll just get the new object which has the same values as the current one (it will still be a new EmailAddress object, not a reference to the original EmailAddress object).

In case if you have just an e-mail address string, not an EmailAddress object, you can use EscapeIdnDomain(String) method instead.

Note Note
Punycode works for domain part only. If you want to send to an e-mail address having international chars in username (not just in domain), you need to set RequestEncoding property to UTF8. Still no guarantee this will work as many SMTP servers can't deal with international characters in an e-mail address. When they support this, they usually expose UTF8SMTP or SMTPUTF8 capability in EHLO response.
See Also