Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logging generated email body #154

Open
hemantvikram opened this issue Nov 19, 2015 · 0 comments
Open

Logging generated email body #154

hemantvikram opened this issue Nov 19, 2015 · 0 comments

Comments

@hemantvikram
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant