MvcMailer
MvcMailer copied to clipboard
Logging generated email body
Hi smsohan,
var client = new SmtpClientWrapper();
client.SendCompleted += SendEmailCompleted;
void SendEmailCompleted(object sender, System.ComponentModel.AsyncCompletedEventArgs e) { var mailMsg = sender as System.Net.Mail.SmtpClient; //mailMsg.message <--What is the alternate way? var emailLog = new EmailLog {}; }
I would like to log the generated message body to the database to keep history of emails sent. When debugging I found that the sender object (SmtpClient) has a variable "message" that holds the generated body and other information pertaining to email but this is not available implementation wise. So, Is it possible to include this as a feature in you next version?
Thanks, Hemant.