6

We need to be able to send an email with cfmail to an email address that contains a latin a with acute. I assume we'll eventually have to allow other Unicode characters too - a sample email address is foobár@example.com. ColdFusion throws an error on this email address, which is technically valid. Since the acute a is a UTF-8 character, and the default encoding for cfmail is UTF-8, I'm not sure what other settings I would need to enable to make this work. Is this possible?

The error I get is Attribute validation error for tag CFMAIL.

Detail: The value of the attribute to, which is currently foobár@example.com, is invalid.

Core Xii
  • 6,270
  • 4
  • 31
  • 42
RaeLehman
  • 1,004
  • 1
  • 7
  • 9
  • @AlEverett attribute validation. Just updated the question. Thanks! – RaeLehman Nov 22 '11 at 17:24
  • If I'm not mistaken, unicode characters are still invalid for emails. However, with [RFC5322](http://tools.ietf.org/html/rfc5322), they are trying to make changes to that. – JonLim Nov 22 '11 at 17:31
  • @JonLim I've found various info online saying things about it being "recently accepted" so I am assuming it's an emerging issue we're going to have to find a workaround for. I'm using the jQuery Validate plugin which does allow them, I sort of assumed that if they were allowed there, then it was becoming more common. But perhaps not! I can always change the validation, but I wanted to see if there was a way to get it working in CF first. – RaeLehman Nov 22 '11 at 17:39
  • 1
    @JonLim Did you mean [RFC 5336 SMTP Extension for Internationalized Email Addresses](http://tools.ietf.org/html/rfc5336)? – Hontvári Levente Nov 22 '11 at 18:29
  • 1
    +1 Hontvári's link. This is the standard that would one day give us Unicode usernames in e-mail addresses... if e-mail is still widely used by the time most deployed MTAs support it. Support today is very poor. Neither ColdFusion nor anything else can *reliably* send mail to foobár@example.com, so anyone using that address is going to find themselves without many people to talk to! – bobince Nov 24 '11 at 22:12

1 Answers1

4

I'm neither an I18N nor email expert but my understanding FWIW is that current systems don't generally support unicode in the local part of the email address, i.e. the mailbox name before the @. Local mail servers may support it and allow a name such as foobár internally, but if that person wants to receive mail from the outside world they will also need an ASCII alias such as foobar.

There is however a mechanism for supporting unicode in the domain portion of the address, which involves conversion to an ASCII representation called punycode. This means an address such as foo@foobár.com will be converted to foo@xn--foobr-0qa.com which current DNS and mail systems will accept.

It's possible to do this conversion in ColdFusion by using existing Java libraries. For more detail see this question.

Community
  • 1
  • 1
CfSimplicity
  • 2,338
  • 15
  • 17