javax.mail.internet.AddressException: Illegal address in string ``''

javax.mail.internet.AddressException: Illegal address in string ``''

at javax.mail.internet.InternetAddress.<init>(InternetAddress.java:114)
at example.Test2.processFolder(Test2.java:150)
at example.Test2.processFolder(Test2.java:64)
at example.Test2.<init>(Test2.java:43)
at example.Test2.main(Test2.java:33)

Solution:
  InternetAddress[] address_old = {new InternetAddress(TO_MAIL)};

If you are using above line for addressing , you need parsing like given below....where TO_MAIL contains the all mail ids where you have to send email seperated by semi colomn(;) ......


 InternetAddress[] address_old = InternetAddress.parse(TO_MAIL,true);

Comments

Popular posts from this blog

Read Images from a xlsx file using Apache POI

Read Excel using Apache POI - Exception in thread "main" org.apache.poi.poifs.filesystem.OfficeXmlFileException:

Struts 2 : Warning :No configuration found for the specified action: 'Login.action' in namespace: '/'