我需要从JavaMail MimeMessage对象获取To/CC/BCC地址.似乎我能做到这一点的唯一方法就是通过getRecepients,但后来我无法分辨出To场上的对手CC和BCC场地.有没有办法做到这一点?
Per*_*ion 13
getRecipients
public Address [] getRecipients(Message.RecipientType type)抛出MessagingException
Run Code Online (Sandbox Code Playgroud)Returns the recepients specified by the type. The mapping between the type and the corresponding RFC 822 header is as follows: Message.RecipientType.TO "To" Message.RecipientType.CC "Cc" Message.RecipientType.BCC "Bcc" MimeMessage.RecipientType.NEWSGROUPS "Newsgroups"
请注意,您永远不会在收到的邮件中找到密件抄送收件人,这就是"密件抄送"的全部内容.