tags:

views:

39

answers:

1

Hi to all, 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());

+1  A: 

Try this:

Address[] copiedAddrs = mime.getRecipients(Message.RecipientType.CC);

and this:

Address[] blindCopiedAddrs = mime.getRecipients(Message.RecipientType.BCC);
David Grant