views:

19

answers:

1

I have a windows desktop application running on clients machines using .NET 4.0. When an error occur, The application catches it and needs to send it to the support team b email.

The question is how to send an email with the full stack trace (including stacktrace for inner exception if there is one) using email?

I tried using the "Mailto:" but It wouldnt work when the body exceeds a certain length.

What options do I have?

A: 

System.Net.Mail namespace contains classes that handle sending mail with the smtp protocol. It may have a size limit, but I haven't found it yet in normal usage.

If you do manage to find a size limit, try writing the error log to a file an attaching it.

Also, as an easier way to do this, you might also consider Log4Net to simplify logging in all manner of ways, including email with the SmtpAppender.

David Culp
The point is that I wanted this to come from the user's email. this will help them see exactly what is going to be sent and give me an email to reply back to.I am not looking for something to send the emails from a predefined email like the case with log4net or system.net.mail
Emad