I'm working on sending transactional emails with AmazonSES. I'm noticing that when two SendEmailRequests are made within a couple of minutes from each other, AmazonSES sends the first email correctly. But the second email includes both email addresses in the to field.
For example, if I'm sending two emails, one to janeDoe@gmail.com and another to jamesSmith@gmail.com. In the email sent to janeDoe@gmail.com she will see that the email has been sent just to her. But jamesSmith@gmail.com will see that the email has been sent to him and janeDoe@gmail.com.
In other words, Jane (the first receiver) is receiving an email that was meant only for James (the second receiver) to see.
Code for email sending
sendEmailRequest
.withDestination(
destination.withToAddresses(to))
.withMessage(message
.withBody(body
.withHtml(new Content()
.withCharset("UTF-8").withData(htmlBody))
.withText(new Content()
.withCharset("UTF-8").withData(textBody)))
.withSubject(new Content()
.withCharset("UTF-8").withData(subject)))
.withSource(from);
amazonSimpleEmailServiceClient.sendEmail(sendEmailRequest);
Does anyone know why this is happening? Is there a glitch in AmazonSES?