views:

107

answers:

2

After reading this discussion and this discussion about using CrashRpt to generate a crash dump and email it to the developers, I've been having a difficult time finding any instructions/tutorials for configuring the email settings used by the library to send the email.

When you call the install() function to initialize CrashRpt, you specify the email address you want the crash dump sent to, but how does the CrashPrt library know how to send the email to that address? Wouldn't the library have to know the email client settings for each individual user?

When a fatal crash occurs in my code, the CrashRpt dialog box pops up and when I enter my email address and click the send button, it takes me to a "Save File" dialog box where I can save the zipped package and the account specified in the Install() function never receives an email.

Thanks in advance for any and all help! I'm clearly missing something.

+1  A: 

What CrashRpt does for emailing:

The email system simply uses MAPI to send your email. Which would try to use your default mail client if you have one, and if it supports MAPI. Take a look at MailMsg.cpp for details.

Personal experience:

In my company's usage of CrashRpt, we modified it a bit though to call a web service that we created which submits the crash report. So we gutted the emailing code completely from CrashRpt. And instead we have in our bug tracking system a section for crashes that were auto submitted when crashes happen.

To find your problem:

I would maybe try to debug the CrashRpt code to see why it's giving you a save dialog. It should instead just open your default mail client. Maybe you have an older version of the library, or maybe the dialog resources are a little messed. Debugging the code will tell you this though.

Most likely MailReport is being called but is failing.

Set a breakpoint in the original CrashRpt code's CrashHandler.cpp at just after the DoModal:

 mainDlg.m_pUDFiles = &m_files;
   if (IDOK == mainDlg.DoModal())
   {
      //Put breakpoint here <---------
      if (m_sTo.IsEmpty() || 
          !MailReport(rpt, sTempFileName, mainDlg.m_sEmail, mainDlg.m_sDescription))
      {
         SaveReport(rpt, sTempFileName);
      }
   }

Check to see why MailReport is not getting called. It's either the dialog resource, or your m_sTo is not filled or you can step through MailMsg.cpp and see where MAPI is failing.

Alternate solution:

An easy fix, if you find above that MailReport is being called, but not succeeding, is to instead just do a ShellExecute and specify a mailto:

You could even try to use the MAPI method, but if that fails to do a mailto:

Brian R. Bondy
A: 

You can find the CrashRpt documentation, FAQ and download a new CrashRpt v1.1 here http://code.google.com/p/crashrpt/