raja
raja

Reputation: 4193

Which method is used to get mail ids given in CC and BCC list in JavaMail?

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

Answers (1)

David Grant
David Grant

Reputation: 14243

Try this:

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

and this:

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

Upvotes: 1

Related Questions