문제

if ((a = m.getRecipients(Message.RecipientType.CC)) != null) {
    for (int j = 0; j < a.length; j++) {

    InternetAddress ia = (InternetAddress)a[j];
    if (ia.isGroup()) {
        InternetAddress[] aa = ia.getGroup(false);
        for (int k = 0; k < aa.length; k++) {
                    cc.append(aa[k].getAddress()).append("; ");
                }
    }
            else
            {
                cc.append(ia.getAddress()).append("; ");
            }

    }
}

Hello I use Javamail to get CC adresses, but when I invoke getRecipients() from message object i got null. With recipient type TO it works. I get mail from Gmail, and on 100 percent message have CC adresses. It was a bug? Maybe I do it wrong.

도움이 되었습니까?

해결책

JavaMail returns what the server tells it. Turn on the protocol trace to see what the server is returning to JavaMail. The Cc information will be in the ENVELOPE response from the IMAP server.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top