I use the MailKit library for .Net and SMTP Client.
I tried another solution to get the identifier of the message sent with the SMTP client to track any response messages.
Before sending a message, add a hidden identifier property to the message headers,
Now continue and send your message, wait about 10 seconds, then you will use the IMAP client to get the Sent Items folder and for each message in your folder, iterate over the message headers and check if any of them are == messageIdentity
, now you Successfully intercept the sent message and get any information about it, such as ID, etc.
source share