The document says that after sending an email, no matter it was successful or not, SES will return a response to the sender, includeing message ID and an error if it wasn't sent successfully.
https://docs.aws.amazon.com/ses/latest/DeveloperGuide/sending-concepts-process.html
I am wondering how to get this response?
I am using SMTP and JavaMail to send emails, like:
transport.sendMessage(msg, msg.getAllRecipients());
The sendMessage
method doesn't return anything. So how can I get the response?
Thanks in advance!
Update:
In https://forums.aws.amazon.com/thread.jspa?messageID=363239, it is said that
SMTP returns the message ID appended to the OK response to the DATA command. For example: 250 Ok 0000aaaaccccaaaacccc-ccccaacc-aaaa-cccc-aaaa-acccccaaaaae-000000
Could anyone teach me how to extract the message ID from the OK response?