Link to home
Start Free TrialLog in
Avatar of private99
private99

asked on

How to read a BCC adress from mail by using Java Mail

Hello,
     Does anyone know how to read the BCC address ?
for example you use a hotmail a/c to send a mail with a list of adresses in bcc, how do we read this bcc list if we receive this mail by using Java Mail ?


Avatar of Mick Barry
Mick Barry
Flag of Australia image

Use:

Address[] bcc = message.getRecipients(Message.RecipientType.BCC);
ASKER CERTIFIED SOLUTION
Avatar of ibro
ibro

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Hi Private

It is never Possible Possible Possible.
Yes Ibro Is right.
You cann't do it.

While Sending the mail bcc is not included in your headers.
It is not even visible to the sender in some mail clients.


Shyam
Absolutely correct, the above code will only work for getting bcc addresses BEFORE the email is sent.
The bcc address are not included in the DELIVERED mail so there is no way of accessing them.
Avatar of private99
private99

ASKER

Thank you to all of you.