Using an own SendMail function

delphi package - automated exception handling
Post Reply
amw
Posts: 4
Joined: Wed Aug 24, 2016 5:08 pm

Using an own SendMail function

Post by amw »

As many of my customers just use web based mail instead of an e-mail client, I'm going the following route:

Use the following settings:

Code: Select all

      madExcept.MESettings.AutoSave := TRUE;
      madExcept.MESettings.AutoSaveIfNotSent := TRUE;
in madExceptionHandler.OnExceptAction I do the following:

Code: Select all

   if action = eaSendBugReport then
   begin
      handled := TRUE;

      1. Copy exceptIntf.BugReport to the clipboard
      2. Show a message box with a small description, and if the user press "open form", then:
          2.1. open http://www.domain.com/webform.php in browser where the user can paste the bug report
          2.2. ????? How to tell madExcept that the bugReport has been sent ?????
   end;
This works very well, but madExcept always saves the bugreport. How can I tell madExcept that the bug report has been sent if 2.1 is executed?
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Using an own SendMail function

Post by madshi »

Does it workaround the problem if you set "exceptIntf.AutoSave := false" and "exceptIntf.AutoSaveIfNotSent := false" when your sending has completed?
amw
Posts: 4
Joined: Wed Aug 24, 2016 5:08 pm

Re: Using an own SendMail function

Post by amw »

yes, this is what I will use now to temporarily disable the AutoSave flags. I think this is something I can live with. Thanks.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Using an own SendMail function

Post by madshi »

FWIW, doing this on "exceptIntf" instead of "MESettings" will automatically only affect the current exception, so it should be a proper and clean solution, and you don't have to "change it back" or anything like that.
amw
Posts: 4
Joined: Wed Aug 24, 2016 5:08 pm

Re: Using an own SendMail function

Post by amw »

Thanks, I'll try that :)
amw
Posts: 4
Joined: Wed Aug 24, 2016 5:08 pm

Re: Using an own SendMail function

Post by amw »

Wonderful, does exactly what I need now :)

Thank you very much for your help!!!
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: Using an own SendMail function

Post by madshi »

My pleasure!
Post Reply