javax.mail problem with "cc" option.

Hi everyone, I'm still struggling getting "cc" option to work in my email application. At this point I have the following syntax for it: if (!cc.equals("")){InternetAddress arrCC[] = InternetAddress.parse(cc); writer.println("arrCC SIZE : " + arrCC.length + "<br>"); //message.setRecipients(Message.RecipientType.CC, arrCC); }

The commented out line is the line causing problems. When I use it, nothing works - email options "to" and "cc" both don't work, but no errors. I tried several syntax variation, but the result is the same. Is there anyone who could tell me what can possibly help me with this?

I don't have any problems with that particular method in JDK 1.4.2_8. Have you tried printing out the results of InternetAddress.parse to make sure your CC addresses are getting set correctly? setRecipients will throw an exception in several circumstances. Are you handling such an exception correctly (i.e. informing the user their settings are incorrect or sending the email with just the TO being set)?

Thanks for responding. I'm using JDK 1.5.0. I did test parse method and the array looks good. I have all my message code being caught by Throwable. If there are errors, I get fairly specific pointers to lines of code....

I don't see anything obvious. You say that this code completes (i.e. you would see a log message from after the call to Transport.send()), right? Maybe your SMTP host is configured to prevent multiple CC's? (a wild guess on my part) Can you run something simple like this:

Thank you for the code. I was able to compile and run the code no problem. I don't think it did anything - didn't get any messages. Does it mean SMTP configuration needs to be reworked? I know nothing about configuring SMTP. Yesterday I asked my network person about looking into it - she knew nothing about it either. So looking into SMTP configuration will be my next frontier. Thank you for your help.