I've been searching the forum and looking at old posts about using JavaMail to send to multiple recipients. I can send to multiple recipients ok, but my problem is I want to see all the recipients on the To line of the email. I tried a few different ways of setting the recipients but they all give me the same thing.
Right now I'm setting the recipients like this:
String recipient_list = "addr1@domain.com,addr2.domain2.com"
msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse(recipient_list, false));
Transport.send(msg);
The problem I have is that the messages get delivered to each recipient, but they are the only ones in the To field. The other address(es) do not show up.
In the debug of the smtp connection it only shows me the last address in the list:
DEBUG SMTP SENT: RCPT TO:<addr2.domain2.com>
DEBUG SMTP RCVD: 250 2.1.5 <addr2.domain2.com>... Recipient ok
Verified Addresses
addr2.domain2.com
How do you get all the recipients to show up in the To field on the resulting email?
Any help is appreciated. Thanks,
James