views:

85

answers:

3

By writing this:

var recipient = new MailAddress("name@abcø.dk");

Notice the "ø" in the domain part.

I get an exception stating:

System.FormatException: The specified string is not in the form required for an e-mail address. at System.Net.Mime.MailBnfHelper.ReadMailAddress(String data, Int32& offset, String& displayName) at System.Net.Mail.MailAddress.ParseValue(String address) at System.Net.Mail.MailAddress..ctor(String address, String displayName, Encoding displayNameEncoding) at System.Net.Mail.MailAddress..ctor(String address)

The address used should be perfectly valid.

So I'm guessing I have to encode the address somehow?

+3  A: 

You probably need to use the encoded variant of the host name. See here, Example of IDNA encoding

Unknown
+6  A: 

RFC-822 states that each part of this domain must be formed entirely of ASCII characters, excluding spaces and control characters. Your email address is not valid according to this standard.

What this means for a internationalized domain name is that you will only get an RFC-822 compliant email address by using the ASCII form of that domain name.

David M
A: 

RFC 1034 describes domain names

The labels must follow the rules for ARPANET host names. They must start with a letter, end with a letter or digit, and have as interior characters only letters, digits, and hyphen. There are also some restrictions on the length. Labels must be 63 characters or less.

rdkleine