Reputation: 4193
I have created a java mail program to send mails. I have doubt regarding which method is used to get mail id which is given in CC and BCC list?. For To list i have used the below code.
Code :
MimeMessage mime = new MimeMessage(session);
mime.addFrom(bean.getFromAddress());
Upvotes: 0
Views: 545
Reputation: 14243
Try this:
Address[] copiedAddrs = mime.getRecipients(Message.RecipientType.CC);
and this:
Address[] blindCopiedAddrs = mime.getRecipients(Message.RecipientType.BCC);
Upvotes: 1