'Only show whose own email after sending email to multiple recipients
I sent the mail to multiple recipients but when I show the mail box's 'Recipient', there is shown the multiple recipients.
I want the mail box's Recipient to show only whose own email after sending mail to multiple recipients.
I have tried change the Message.RecipientType.TO -> Message.RecipientType.BCC
but it was hide all of recipients.
How could resolve it?
msg.setFrom(new InternetAddress("[email protected]", "test account"));
msg.setRecipients(Message.RecipientType.TO, toClient);
msg.setSubject(title);
msg.setContent(content, "text/html; charset=UTF-8");
Transport trans = session.getTransport("smtp");
trans.connect();
try {
trans.sendMessage(msg, toClient);
} catch (Exception e) {
e.printStackTrace();
} finally {
trans.close();
}
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
