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);

Popular posts from this blog

Can not connect to git using ssh (Permissions 0644 for '/root/.ssh/id_rsa' are too open.

Upload file on Google cloud storage using Java servlet on google app engine

Create Nested table inside a table on a pdf document using iText