InternetAddress exception
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   tom_cwh
Posted On:   Tuesday, January 15, 2002 08:12 AM

How to solve the following exception.

javax.mail.internet.AddressException: Illegal character in local name in string ``Undisclosed-Recipient:@xxx.xxx.xxx''

Also, how to use the following method of InternetAddress class to print the Address, as some email address are not standard ASCII characters
InternetAddress.toUnicodeString()

Re: InternetAddress exception

Posted By:   Simon_Ablett  
Posted On:   Friday, January 18, 2002 06:28 AM

I believe, and I might be wrong here, that the InternetAddress class will only accept US-ASCII characters and that your string might contain characters not belonging to this set. You might want to check out RFC822.



To use the 'InternetAddress.toUnicodeString' method:



InternetAddress add = new InternetAddress("name@companyname.com");

String add = in.toUnicodeString();



This still wouldn't allow you to use an InternetAddress object containing non- ASCII characters. What it will do is return the ASCII characters that make up the address as Unicode ones.

Regards,
Simon
About | Sitemap | Contact