Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to send email to recipient with umlauts in domain name?

In my app I have to send email to recipient who has umlauts in domain name. Example: "test@äöü.test.com"

I'm using cfmail tag and I'm getting such error: "invalid definition for attribute to at tag mail" "Invalid E-Mail Address definition (test@äöü.test.com)"

Is there any way to send email to such recipients in coldfusion?

like image 202
balytskyi Avatar asked Jun 15 '11 10:06

balytskyi


People also ask

Can you use umlaut in a domain name?

Nowadays, umlauts can be used for domain names since all current browsers automatically convert the umlauts to ae, oe and ue, depending on the country's language.

Can email addresses have umlauts?

Issue: Oracle B2C Service does not currently support Email Address Internationalization in sending responses to addresses that contain non-ASCII characters, such as umlauts or accents, in the local part of an email address. The local part of the email address consists of the characters in front of @.


1 Answers

There is even a easier solution! Why not use Oracles built in class: http://download.oracle.com/javase/6/docs/api/java/net/IDN.html#toUnicode(java.lang.String)

Then you only have to do this (example shows from punycode to Unicode):

<cfset strUrl = "xn--land-poa.se" />

<!--- Create a Java URL. --->
<cfset jUrl = CreateObject( "java", "java.net.IDN" ).toUnicode(strUrl) />

<cfoutput>
#jUrl#

You don´t have to download anything!

like image 162
Molnfront Avatar answered Oct 05 '22 01:10

Molnfront