dcsimg
javax.mail.internet.AddressException: Illegal whitespace in address in string
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   harish_kumar
Posted On:   Friday, November 1, 2002 11:27 PM

Hi, V have written a software to scan pop3 email accounts using the Javax.mail package. Whenever the From: address contains a "string" instead of a valid email address, it results in AddressException saying "Illegal whitespace in address in string". Part of trace is as below: Caught Exception: javax.mail.internet.AddressException: Illegal whitespace in address in string ``SMS Revenue Share Applications'' javax.mail.internet.AddressException: Illegal whitespace in address in string ``SMS Revenue Share Applications'' at javax.mail.internet.InternetAddress.checkAddress(InternetAddress.java:837) at javax.mail.internet.InternetAddress.parse(InternetAddress.java:748) at javax.mail.internet.InternetAddress.p   More>>

Hi, V have written a software to scan pop3 email accounts using the Javax.mail package. Whenever the From: address contains a "string" instead of a valid email address, it results in AddressException saying "Illegal whitespace in address in string". Part of trace is as below:

Caught Exception: javax.mail.internet.AddressException: Illegal whitespace in address in string ``SMS Revenue Share Applications''
javax.mail.internet.AddressException: Illegal whitespace in address in string ``SMS Revenue Share Applications''
at javax.mail.internet.InternetAddress.checkAddress(InternetAddress.java:837)
at javax.mail.internet.InternetAddress.parse(InternetAddress.java:748)
at javax.mail.internet.InternetAddress.parse(InternetAddress.java:501)
at javax.mail.internet.MimeMessage.getAddressHeader(MimeMessage.java:586)
at javax.mail.internet.MimeMessage.getFrom(MimeMessage.java:29

How do we solve this problem?

Thanks,
Harish

   <<Less

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

Posted By:   AlessandroA_Garbagnati  
Posted On:   Sunday, November 3, 2002 03:40 AM

Hi,

Well, a whitespace is not a valid char inside an email address. If you try to convert a string that is not a valid email address, you will get an error.


I think you can take a look at the RFC 2822, that should (if I'm not wrong) contains all the specifications regarding the format of an email address.

About | Sitemap | Contact