Я пытаюсь отправить несколько писем с помощью Java Mail -Отправка нескольких сообщений электронной почты по javax.mail
При добавлении одного получателя -
message.addRecipient(Message.RecipientType.TO, new InternetAddress(“[email protected]”));
Он отлично работает, но не тогда, когда я добавляю несколько электронную почту адреса -
Вот код
message.addRecipient(Message.RecipientType.TO, new InternetAddress(“[email protected]”));
message.addRecipient(Message.RecipientType.TO, new InternetAddress(“[email protected]"));
message.addRecipient(Message.RecipientType.CC, new InternetAddress(“[email protected]"));
message.addRecipient(Message.RecipientType.CC, new InternetAddress(“[email protected]"));
message.addRecipient(Message.RecipientType.BCC, new InternetAddress(“[email protected]"));
почта отправляется и принимается, но когда Я проверяю по электронной почте [email protected]
. Я не вижу, что письмо было отправлено также [email protected]
или наоборот. Я тоже не вижу CC в списке.
почта детали из [email protected]
from: [email protected]
to: [email protected]
date: Thu, Sep 8, 2016 at 4:38 PM
subject: Test
детали почты от [email protected]
from: [email protected]
to: [email protected]
date: Thu, Sep 8, 2016 at 4:38 PM
subject: Test
детали почты от [email protected]
from: [email protected]
to: [email protected]
date: Thu, Sep 8, 2016 at 4:38 PM
subject: Test
почты подробности от [email protected]
from: [email protected]
to: [email protected]
date: Thu, Sep 8, 2016 at 4:38 PM
subject: Test
Я попытался изменить логику немного, но тот же результат -
message.addRecipients(Message.RecipientType.TO, InternetAddress.parse(“[email protected], [email protected]"));
message.addRecipient(Message.RecipientType.CC, InternetAddress.parse(“[email protected], [email protected]”));
message.addRecipient(Message.RecipientType.BCC, InternetAddress.parse(“[email protected]"));
Я ожидал увидеть детали, как -
from: [email protected]
to: [email protected], [email protected]
cc: [email protected], [email protected]
date: Thu, Sep 8, 2016 at 4:38 PM
subject: Test
Можете ли вы разместить [mcve]? Связано: http://stackoverflow.com/questions/13854037/send-mail-to-multiple-recipients-in-java Также обратите внимание, что в вашем опубликованном коде есть некоторая «цитата» ('' 'vs' '') –
Пожалуйста, избегайте цитаты, на самом деле « –