gpt4 book ai didi

java - 从 MimeMessage 获取 To/CC/BCC 地址?

转载 作者:搜寻专家 更新时间:2023-11-01 01:00:52 24 4
gpt4 key购买 nike

我需要从 JavaMail MimeMessage 对象获取 To/CC/BCC 地址。似乎我能做到这一点的唯一方法是通过 getRecepients,但我无法分辨谁在 To 字段与 CC 中和 BCC 字段。有没有办法做到这一点?

最佳答案

getRecipients

public Address[] getRecipients(Message.RecipientType type) throws MessagingException

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"

关于java - 从 MimeMessage 获取 To/CC/BCC 地址?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8747828/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com