如何发送电子邮件到收件人与域名的umlauts? [英] How to send email to recipient with umlauts in domain name?

查看:360
本文介绍了如何发送电子邮件到收件人与域名的umlauts?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我必须发送电子邮件给收件人在域名中有umlauts。
例如:
test@äöü.test.com

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

我正在使用cfmail标记,我得到这样的错误:
标签邮件的属性无效定义
电子邮件地址定义无效(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)"

推荐答案

还有一个更简单的解决方案!为什么不使用在类中构建的Oracle:
http://download.oracle.com/javase/6/docs/api/java/net/IDN.html#toUnicode(java.lang.String

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)

然后你只需要这样做(例如从punycode到Unicode):

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#

您不必下载任何内容!

这篇关于如何发送电子邮件到收件人与域名的umlauts?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆