Problem sending a report via email
Problem sending a report via email
Hi
I set madexcept to send the report via smtp and "act as smtp client".
I entered the smtp server, account and password.
On several computers it works as expected but on others it gives a popup that there was an error (without any description) sending the report and the report is lost.
I guess the problem is related to a blocked port so how can I know that there was an error so I can give the user another option to send me the bug report?
I set madexcept to send the report via smtp and "act as smtp client".
I entered the smtp server, account and password.
On several computers it works as expected but on others it gives a popup that there was an error (without any description) sending the report and the report is lost.
I guess the problem is related to a blocked port so how can I know that there was an error so I can give the user another option to send me the bug report?
Re: Problem sending a report via email
Any feedback on this one?
Re: Problem sending a report via email
You can enable e.g. MAPI in addition to SMTP. If SMTP fails, madExcept will then automatically use MAPI.
Alternatively, you can use RegisterExceptActionHandler() to overwrite madExcept's bug report sending. In your handler you can then call the exported madExcept functions like "SendSmtpMail()" manually, check the result and maybe do other stuff if it fails.
Alternatively, you can use RegisterExceptActionHandler() to overwrite madExcept's bug report sending. In your handler you can then call the exported madExcept functions like "SendSmtpMail()" manually, check the result and maybe do other stuff if it fails.
Re: Problem sending a report via email
I now enabled the MAPI as well but if the client does not have an email client installed (if he is using Gmail web for example) then it won't work.
I do catch the exception to manually process it and after processing it, I call exceptIntf.SendBugReport(); but it's a procedure so there is no return value
I also tried to change it to use SSL but it doesn't let me enter the port (a bug?) so maybe it's using the wrong one
I see there is a function called sendsmtpmail but do you have an example on how to use it along with the bug report as an attachment?
I do catch the exception to manually process it and after processing it, I call exceptIntf.SendBugReport(); but it's a procedure so there is no return value
I also tried to change it to use SSL but it doesn't let me enter the port (a bug?) so maybe it's using the wrong one
I see there is a function called sendsmtpmail but do you have an example on how to use it along with the bug report as an attachment?
Re: Problem sending a report via email
You could check what "TIMEException.SendBugReport" does internally. It calls "SendBugReportEx". Which is also what the function "madExcept.SendBugReport" does. So you could call "madExcept.SendBugReport" instead of "exceptIntf.SendBugReport" to get a result value. I don't really have an example right now. I'd have to browse through the madExcept source code to figure out the details myself.
Re: Problem sending a report via email
I started playing with SendSmtpMail and gave it the ssl version (server/port) of sending an email but it fails with no error message so I don't know why. When giving it the no-ssl version (server/port), it works but while port 25 is mostly blocked, maybe the ssl port isn't so how can I make it use the ssl port? In madexcept settings window I can't change the port and in the function it fails with no reason
Also, I tried
if madExcept.SendBugReport(exceptIntf.BugReport,nil) <> yes then
showmessage('blah blah');
it failed but I didn't see my popup
Also, I tried
if madExcept.SendBugReport(exceptIntf.BugReport,nil) <> yes then
showmessage('blah blah');
it failed but I didn't see my popup
Last edited by emailaya on Thu Nov 19, 2015 1:11 pm, edited 1 time in total.
Re: Problem sending a report via email
Are you using Smtp Server oder Smtp Client? For the Server you can't change all those settings. But for the client it should work just fine. It does on my PC at least.
Re: Problem sending a report via email
weird but now I can change it.
On my computer, when sending with no encrypt and port auto (I guess 25), it works but when sending using ssl and port 465 (in gmail it works), madexcept fails with no error message
On my computer, when sending with no encrypt and port auto (I guess 25), it works but when sending using ssl and port 465 (in gmail it works), madexcept fails with no error message
Re: Problem sending a report via email
Well, you could try to debug madExcept.pas, don't know what else to suggest. The SSL encryption stuff is handled by Windows itself. See "TSmtp" class.
Re: Problem sending a report via email
Usually ssl requires 2 dlls to support ssl connection, does madexcept needs them or is it using an internal support?
When compiling my project, madexcept does not have the blue bullets (though it is in the uses clause of the project) so I can't debug it
When compiling my project, madexcept does not have the blue bullets (though it is in the uses clause of the project) so I can't debug it
Re: Problem sending a report via email
As I said, the SSL encryption is handled by Windows itself (win32 APIs), so I don't need any dlls.
You need to copy madExcept.pas and mad.inc into your project folder. After that you should be able to set breakpoints and debug.
You need to copy madExcept.pas and mad.inc into your project folder. After that you should be able to set breakpoints and debug.
Re: Problem sending a report via email
OK, debug shows I got "'HELO failed ()" (empty ())
any idea what can cause this?
any idea what can cause this?
Re: Problem sending a report via email
Maybe the SSL certificate is out of date, or something? I'm not really sure. There are some additional options you can set in the call to "AcquireCredentialsHandle". Currently I'm doing:
You could try whether any of the other options are needed to make this specific SMTP server work. See here for a description of the other available options:
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
Code: Select all
FSchannelCred.dwFlags := 16; // SCH_CRED_NO_DEFAULT_CREDS
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
Re: Problem sending a report via email
The link is invalid: https://msdn.microsoft.com/en-us/librar ... 85%29.aspx
I use this email address in my gmail for sending, and I just set the smtp server and the port (465) and it works with no problem
I use this email address in my gmail for sending, and I just set the smtp server and the port (465) and it works with no problem
Last edited by emailaya on Thu Nov 19, 2015 2:17 pm, edited 1 time in total.