using AutoSendBugReport

delphi package - automated exception handling
Post Reply
MarkusD
Posts: 14
Joined: Wed Jan 04, 2017 9:32 am

using AutoSendBugReport

Post by MarkusD »

Hi,

I wrote an application which sends mails with AutoSendBugReport from a users server. But I can't get it running, if I do call AutoSendBugReport nothing happens, I don't receive the mail.

If I use the madTestMailAPIs sample I'm able to send a mail from the users server. But which properties of "MESettings" do I have to set, to act the same like in the attached screenshot of madTestMailAPIs with code?

I tried filling these fields

Code: Select all

  MESettings.MailAddr := gConstData.AMMSIniFile.ReadString(sPaths, 'MailAddr', sMailAddr);
  MESettings.MailFrom := gConstData.AMMSIniFile.ReadString(sPaths, 'MailFrom', sMailFrom);
  MESettings.SmtpServer := gConstData.AMMSIniFile.ReadString(sPaths, 'SmtpServer', sSmtpServer);
  MESettings.SmtpPort := 25;

Code: Select all

  if AutoSendBugReport(AMMSService.DisplayName, Screenshot, MESettings, True) <> Yes then begin
    TMSLogger.Error('Error sending mail!');
  end;

But that does not work.

What understanding madExcept realy makes very difficult is, that the property names of MESettings does not correspond to the settings in the .mes file. For example there is "MESettings.MailAddr" or "MESettings.MailFrom". To which settings in the .mes file are identical?

What would help a lot would be a feature in the madTestMailAPIs application which is able to create a .mes file of the settings in the dialog. so it we be very easy to try sending a mail with the flexibilty of the GUI and afterwards using the .mes file in the IDE of Delphi.

BTW, it is not possible to set the "port" value in the "madExcept 4.0.16 settings" dialog in the Delphi IDE. If I set it to "25" and press <OK> the value in the .mes file ist still "HttpPort=0".

TIA, Markus
Attachments
2017-01-25_152022.png
2017-01-25_152022.png (12.27 KiB) Viewed 2825 times
2017-01-25_151957.png
2017-01-25_151957.png (24.21 KiB) Viewed 2825 times
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: using AutoSendBugReport

Post by madshi »

Port 0 means default port. If you overwrite that with 25, it's still the default, so it's kept as 0.

The "madTestMailAPIs" sample is stone age, I haven't tested it in a long time. I should probably delete it, or update it (quite a bit of work).

It seems you want to use SMTP mailing? You can try using "SendSmtpMail()" instead of "AutoSendBugReport()". That may make things a bit easier because you can feed all required parameters in directly, instead of having to modify MESettings.

One thing that has crept up recently is that some/many email servers now check "MailFrom" and refuse emailing if it's not set to a reasonable email address. See also here:

viewtopic.php?f=4&t=28330
Post Reply