Im using AWS Lambda for sending emails by Amazon SES.

Each time that the request send_email succeeds I got the message id like confirmation. But now, I want to use somehow this messageId. For example to know if this message concretelly get delivered or bounced.

CloudWatch offers me metrics, with the number of delivered or bounced messages but I want to look throught each one.

¿Is there any statement that allows to know the state of a message by id?


Due to the asynchronous nature of SMTP and how mails are being routed, you can't have this information immediately when sending an e-mail (via SES or otherwise).

However, AWS provides a feedback system which notifies an SNS topic when a message is delivered, bounced, or a complaint was received.

While the documentation is very detailed, the general idea is that you subscribe your own lambda(s) to the configured SNS topic(s) and you can then handle these events as you see fit (i.e. persist data on DynamoDB, call your unsubscribe API and so on).