Using an own SendMail function

delphi package - automated exception handling

Using an own SendMail function

Postby amw » Wed Aug 24, 2016 5:12 pm

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?
amw
 
Posts: 4
Joined: Wed Aug 24, 2016 5:08 pm

Re: Using an own SendMail function

Postby madshi » Mon Aug 29, 2016 4:48 pm

Does it workaround the problem if you set "exceptIntf.AutoSave := false" and "exceptIntf.AutoSaveIfNotSent := false" when your sending has completed?
madshi
Site Admin
 
Posts: 9432
Joined: Sun Mar 21, 2004 5:25 pm

Re: Using an own SendMail function

Postby amw » Mon Aug 29, 2016 6:19 pm

yes, this is what I will use now to temporarily disable the AutoSave flags. I think this is something I can live with. Thanks.
amw
 
Posts: 4
Joined: Wed Aug 24, 2016 5:08 pm

Re: Using an own SendMail function

Postby madshi » Mon Aug 29, 2016 6:33 pm

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.
madshi
Site Admin
 
Posts: 9432
Joined: Sun Mar 21, 2004 5:25 pm

Re: Using an own SendMail function

Postby amw » Mon Aug 29, 2016 6:41 pm

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

Re: Using an own SendMail function

Postby amw » Mon Aug 29, 2016 6:49 pm

Wonderful, does exactly what I need now :)

Thank you very much for your help!!!
amw
 
Posts: 4
Joined: Wed Aug 24, 2016 5:08 pm

Re: Using an own SendMail function

Postby madshi » Mon Aug 29, 2016 6:53 pm

My pleasure!
madshi
Site Admin
 
Posts: 9432
Joined: Sun Mar 21, 2004 5:25 pm


Return to madExcept

Who is online

Users browsing this forum: No registered users and 3 guests