?
Solved

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

Posted on 2003-03-29
6
Medium Priority
?
9,090 Views
Last Modified: 2007-12-19
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
Comment
Question by:jbmjlm
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 1

Expert Comment

by:olegtim
ID: 8233235
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
 
LVL 15

Accepted Solution

by:
ozymandias earned 100 total points
ID: 8233414
javax.mail.internet.address is an implementation of RFC822 addresses only.

See http://www.faqs.org/rfcs/rfc822.html, section 6.
0
 
LVL 1

Assisted Solution

by:s_venkataramani
s_venkataramani earned 100 total points
ID: 8235878
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
 

Expert Comment

by:CleanupPing
ID: 9058401
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
 
LVL 15

Expert Comment

by:jimmack
ID: 9735576
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

Get 15 Days FREE Full-Featured Trial

Benefit from a mission critical IT monitoring with Monitis Premium or get it FREE for your entry level monitoring needs.
-Over 200,000 users
-More than 300,000 websites monitored
-Used in 197 countries
-Recommended by 98% of users

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Suggested Courses
Course of the Month9 days, 21 hours left to enroll

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question