首页 > 编程知识 正文

java邮件发送队列控制频率,java邮件发送成功

时间:2023-05-06 14:44:50 阅读:210815 作者:2774

I am facing one problem while extracting BCC address from incoming mail.

Here is the sample code that is used.

public EmailVO dumpEnvelope(Message m) throws Exception {

if ((addresses = m.getRecipients(Message.RecipientType.BCC)) != null) {

emailVO.setBcc(this.getAddresses(addresses, "BCC"));

}

}

I am getting null value in BCC.

While debugging I found BCC recipient's name in header field but I am not able to access that header.

Is this code issue or there is some specific setting while sending mail like not to include BCC fields?

You can check your Message object which contains all the details about the mails.

As the BCC is the part of mail but also it will be hidden, but as per my knowledge you can retrieve the information from your mail headers.

Address[] addresses = m.getHeader("Your Header Name HERE");

This will give you all the details regarding your particular header tag in mails.

for e.g.

Address[] addresses = m.getHeader("Delivered-To");

This tag will give you all the information about the recipients of the mail, which will also include BCC.

you can also add your custom headers for mail.

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。