dcsimg
How to read BCC addresses using Java Mail
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sita_Mulomudi
Posted On:   Friday, July 12, 2002 02:51 PM

Hi, My application uses Java Mail API to read emails from SendMail server (unix system). I am able to read TO and CC addresses but am not able to read BCC. This is the code that I used.. Address[] bccAddr = msg.getRecipients(Message.RecipientType.BCC); InternetAddress inet=null; for (int f = 0; bccAddr != null && f < bccAddr.length; f++) { inet=new InternetAddress(bccAddr[f].toString()); System.out.println(" ~~~~ getAddressList(): Reading BCC addr: "+inet.getAddress()); } Thanks in advance..    More>>


Hi,
My application uses Java Mail API to read emails from SendMail server (unix system). I am able to read TO and CC addresses but am not able to read BCC. This is the code that I used..


Address[] bccAddr = msg.getRecipients(Message.RecipientType.BCC);

InternetAddress inet=null;

for (int f = 0; bccAddr != null && f < bccAddr.length; f++)

{

inet=new InternetAddress(bccAddr[f].toString());

System.out.println(" ~~~~ getAddressList(): Reading BCC addr: "+inet.getAddress());

}


Thanks in advance..
   <<Less

Re: How to read BCC addresses using Java Mail

Posted By:   Christopher_Koenigsberg  
Posted On:   Monday, July 15, 2002 08:53 AM

My application uses Java Mail API to read emails from SendMail server



Um, you don't READ mail from a SendMail server. You SEND mail through a SendMail server.



I assume you are actually READING mail from a POP or IMAP server, on the same Unix host as the Sendmail, is that what you mean?



Anyway, once a message has been sent, all the "BCC" addresses are gone. That's the whole point of putting them in the "BCC" header field, to have them removed when the message is actually sent.



You might have had addresses on the "BCC" field when you SENT a message out through the SendMail server (this is where you are getting confused, maybe?), but once it has been accepted for delivery, poof the BCC field is gone. And if you then retrieve a copy (via POP or IMAP), from a mailbox to which a copy of the mail was delivered, you won't find any BCC field.



If you got your copy from being BCC'ed, it means that your address will be in the SMTP envelope RCPT TO field, and maybe in some of the "Received...... for..." headers, but nowhere else. Your address won't be in any of the ordinary destination address headers, e.g. it won't be in the "To" or "Cc" fields, for instance.

About | Sitemap | Contact