When customers enter email addresses with non-ascii chars like äüö our SMTP rejects to process them.
So I think might be there is a solution to handle those domains myself and convert them to punyocode.
Is there a simple way of doing so using c#?
Would this work anyway?
The problem with this approach is that you'll be changing the email addresses.
The email addresses
bevan@example.com
andbevän@example.com
are different email addresses, however much they appear the same.Making the change you suggest will break email - people might receive the messages, but they won't be able to reply to them.
Your SMTP server that doesn't handle accented characters sounds like a dinosaur. Much as it might be a pain in the proverbial, replacement and/or upgrade is likely the best solution.
You'll likely be able to get more appropriate assistance over on ServerFault.
You can use
Uri.DnsSafeHost
to convert to Punycode:In app.config:
Result: