Hi amars,
To save the status of each email you need to use SendCompleted event.
Inside SendCompleted event you have to write code to save the success status of email .
If the e.Error != null then write code to save fail status else write code to save success status.
amars says:
smtp.SendCompleted += (s, e) => { smtp.Dispose(); };
Change above line wioth below.
smtp.SendCompleted += (s, e) =>
{
if (e.Error != null)
{
// Error occurred when sending mail.
// Write code to save fail status.
}
else
{
// Message sent.
// Write code to save success status.
}
smtp.Dispose();
};
For more details refer below link.
SmtpClient.SendCompleted Event