javamail - Unable to read BCC field of sent mails in java -


i facing 1 problem while extracting bcc address incoming mail. here sample code used.

 public emailvo dumpenvelope(message m) throws exception {              emailvo emailvo = new emailvo();         if ((addresses = m.getrecipients(message.recipienttype.bcc)) != null) {             emailvo.setbcc(this.getaddresses(addresses, "bcc"));         } } 

i getting null value in bcc. while debugging found bcc recipient's name in header field not able access header. code issue or there specific setting while sending mail not include bcc fields?

you can check message object contains details mails. bcc part of mail hidden, per knowledge can retrieve information mail headers.

address[] addresses = m.getheader("your header name here"); 

this give details regarding particular header tag in mails.

for e.g.

address[] addresses = m.getheader("delivered-to");  

this tag give information recipients of mail, include bcc.

you can add custom headers mail.


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -