Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

How to add the list of Cc and Bcc recipients in sendrawemail (java). I'm just adding all the recipients to one list and sending the mail. There is no separate method to set Cc and Bcc for SendRawEmailRequest.

Is there any way to set object of Destination type?

List<String> receipients = new ArrayList<String>();
receipients.addAll(mailToRecipients);
receipients.addAll(mailCcRecipients);
receipients.addAll(mailBccRecipients);

SendRawEmailRequest rawEmailRequest = new   SendRawEmailRequest(rawMessage).withDestinations(receipients);
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
557 views
Welcome To Ask or Share your Answers For Others

1 Answer

Regarding SendRawEmail, you should be able to differentiate To, Cc, and Bcc destinations by setting them in your raw message headers. If you don't explicitly specify destinations in the request object, the headers will be checked instead. If you do, the headers won't be checked.

Here's a great example regarding this problem that JustinC@AWS shared on the AWS forums:

   Destinations: (empty)
   To: [email protected]
   Cc: [email protected]
   Bcc: [email protected]

The above message will be sent to all three of A@, B@, [email protected]. In contrast, if you send the following input:

   Destinations: [email protected]
   To: [email protected]
   Cc: [email protected]
   Bcc: [email protected]

That message will be delivered only to [email protected].


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...