I'm using Amazon SES to send email. I've also set up Amazon SNS to receive notifications when emails bounce for whatever reason. This is working fine.
In the bounce notification I receive, I can see the date, the sender and the recipient. But the subject of the mail is not listed. See example
I do see a messageId
in there. Is there an API to retrieve the message details? I also looked at Amazon SQS, but I'm not sure if that will work.
You can't retrieve message details by messageID
after the message has been sent, as there is no API call available to do so. You would need to store relevant details about the message along with the message ID given in the successful response from SES when sending the email (either through the API or SMTP). The Developer Guide covers a similar case of retrieving the recipients, which mentions that you would need to
store a mapping between [your own] identifier and the Amazon SES message ID that Amazon SES passes back to you when it accepts the email.
This answer by an Amazonian in an SES support thread (albeit from 2012) also reinforces that you'd need to record the message ID when you send the message.
if you record the message ID, you can use the message ID to identify the [e-mail message] that bounced or complained and then update the mailing list.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With