3

How do I send email to non-Ascii email ID, for example I have adad@ÄÖß.com as emailID and when I try to send email to this emailID using

sendTo="adad@ÄÖß.com";
MailMessage msg = new MailMessage();
msg.To.Add(sendTo); 

msg.To.Add(sendTo) throws an error saying "The specified string is not in the form required for an e-mail address.".

Did you guys face this ever? Is this possible? if yes, Any idea of how I can get this working?

Vinay Pandey
  • 8,589
  • 9
  • 36
  • 54

3 Answers3

2

Have a look at this its Jon Skeet doing the job once again.

Community
  • 1
  • 1
Pranali Desai
  • 974
  • 1
  • 7
  • 22
0

System.Uri has a config parameter for IDN support. I'm not sure if this affects MailMessage, too, or if there is an additional parameter for it.

http://msdn.microsoft.com/en-us/library/system.uri.aspx

<configuration>
  <uri>
    <idn enabled="All" />
    <iriParsing enabled="true" />
  </uri>
</configuration>
Hinek
  • 9,519
  • 12
  • 52
  • 74
0

I just found this, it might help you: Convert non-ascii domain to SMTP compatible

Community
  • 1
  • 1
Hinek
  • 9,519
  • 12
  • 52
  • 74