In 2008 Jeff wrote a post on crashing responsibly. In that spirit, I'm trying to add a "send bug report" button to my crash error dialog. The idea is that the user can easily send a full bug report which already includes version information, OS info, stack trace... This information should be put in the message body or in attachment files.
Unfortunately, sending such an email from a .NET application appears to be non-trivial:
- System.Net.Mail is not what I am looking for: I can't be sure that a connection to an SMTP server can be made in all environments, and I don't want to put the burden of configuring the local SMTP hostname and port on my users. Instead, I just want to launch the existing email software on the system with a precomposed message.
- Using the OS to open a "mailto:" URL works, but there are annoying restrictions to the amount of data that can be passed this way. Also, it appears that attachments are not really supported by the mailto spec.
- mapi.dll would probably do what I want as illustrated by this codeproject article, but I read elsewhere that mapi.dll is fundamentally incompatible with .NET causing random crashes.
Has anyone out there found a safe and reliable solution to do this?