Emad Gabriel
Emad Gabriel

Reputation: 3707

Sending Email error reports from windows desktop application

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?

Upvotes: 0

Views: 605

Answers (1)

David Culp
David Culp

Reputation: 5480

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.

Upvotes: 1

Related Questions