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);
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
Post a Comment