views:

18

answers:

1

Hi Guys,

I have mailto:test@维奈.com on an image which when clicked opens the email client, but the emailID appears as asas@维奈.com .

Any Idea how I can get mailto: link working for IDN domains?.

A: 

I think this is where punycode representation comes in. Punycode is a method of converting UTF-8 domain names into an ASCII string that will work in systems that can't deal with Internationalized Domain Names.

test@维奈.com

becomes

mailto:[email protected]

I expect there is a library for ASP.NET that can convert unicode domain names into such an ACE string.

Related: Punycode online converter

Pekka
but this will display [email protected] in the email client and this can be confusing for the user.
Pranali Desai
@Pranali I agree, but I'm afraid this may the only way to get it reliably done. Your problem at hand may be an encoding problem, but older mail clients are likely to have problems with Unicode IDNs. That is why Punycode was introduced as a fallback. I can be wrong - I'm not an expert in the field - but I think that's the state of affairs here.
Pekka
HmmInput String UTF8 test@维奈.comPrepared String PUNYCODE Error:Input does not meet STD3 rules for domain name format.
mplungjan
@mplung you need to encode the domain name portion only.
Pekka
@Pekka, I am also not getting a way to test whether the email is actually sent or not.Can you help me with a way to test this?.
Pranali Desai
@Pranali if you're using the user's E-Mail client using a `mailto` link, there is definitely no way to check whether the message was actually sent.
Pekka
@Pekka,but is there a place where I can create IDN emailID and test the methods by sending email to this IDN emailID. because right now even if punycode is working I have no way to test it.
Pranali Desai
@Pranali I don't understand. Do you want to test the validity of the address? You could do that on server side but hardly in the client's browser. What exactly are you trying to achieve?
Pekka
@Pekka, I think I have confused you, I understand and agree that I have to use punycode, but so far I haven not tested whether the email I am sending is actually being sent because I dont have an IDN email ID. So can you tell me where can I create IDN email ID so that I can actually test the code. thanks for all your help. I really appreciate all your effort.
Pranali Desai
@Pranali I don't know how to create a Punycode address in ASP if that's what you're asking: You'll have to search for a library or ask another question about it. If you're looking for a manual way, you can use the conversion tool I link to above to try it out.
Pekka
@Pekka, I am creating the punycode by creating a Uri and then Uri.DnsSafeHostName so that is not an issue, but I dont have an IDN emailID to which I can send email using puny encoded emailID in mailto ans test that the mail has actually been sent.
Pranali Desai
@Pranali ah, I see! Hmm, this is a good question - I don't know any mail providers with IDN domains, and I don't have any myself. That would be worth a separate question, maybe somebody knows one.
Pekka
@Pekka, I am asking it as a seperate question and if punycode works I will let you know.
Pranali Desai