Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 9297
  • Last Modified:

javax.mail.internet.AddressException: Illegal whitespace in address in string

The javax.mail.internet.Address class returns an address exception when some of the email addresses contain a blank. For example, name@yahoo.com is OK, but this type of address, John Smith/City/COMP/@COMPUS, will cause the address exception. This is a valid address format, so why doesn't the java class handle it? Do any Java experts out there have a solution to avoid this problem? Your help would be greatly appreciated. Thank you.  
0
jbmjlm
Asked:
jbmjlm
2 Solutions
 
olegtimCommented:
This is valid email?? Hmm, first time I see something like this and yes there is exception thrown for this address. Would love to hear if anyone has a solution for that.
0
 
ozymandiasCommented:
javax.mail.internet.address is an implementation of RFC822 addresses only.

See http://www.faqs.org/rfcs/rfc822.html, section 6.
0
 
s_venkataramaniCommented:
The email address "John Smith/City/COMP/@COMPUS" follows the X.502 address protocol and its generally supported by Lotus Notes Domino & Exchange servers.

Since javax.mail doesn't support this address implementation, you are getting an error. So eventhough the email address is valid, its only possible to go with "john.smith@yourcompany.com"

Hope this helps for you...
Cheers
Venkat
0
 
CleanupPingCommented:
jbmjlm:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0
 
jimmackCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Split between ozymandias and s_venkataramani

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jimmack
EE Cleanup Volunteer
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now