SendInBackground option changes email content
Posted: Wed Jul 26, 2017 4:19 pm
Hello,
we use an own event handler with a specialized form for displaying bugreports. When the user selects to send the bug report
In the first case (the commented case) the bug report email is composed correctly with the given text and the two attachments (bugreport and screenshot).
But when I set
the composed email has gone and instead of it the bugreport text is used. The screenshot has gone completely.
I would like to await if the email could be sent and then, if this fails provide a special file creation where both file will be stored with a timestamp in its filename:
This works fine, except of the wrong email content and missing attachments.
Thank you for help!
Best regards,
Michael
we use an own event handler with a specialized form for displaying bugreports. When the user selects to send the bug report
Code: Select all
procedure ktExceptEventHandler(const exceptIntf: IMEException; var Handled: boolean);
var
...
begin
if exceptIntf.CrashedThreadId = MainThreadID then
begin
...
// if chkSendReport.Checked then
// exceptIntf.SendBugReport;
if chkSendReport.Checked then
begin
exceptIntf.SendInBackground := False;
exceptIntf.SendBugReport;
end;
...
But when I set
Code: Select all
exceptIntf.SendInBackground := False;
I would like to await if the email could be sent and then, if this fails provide a special file creation where both file will be stored with a timestamp in its filename:
Code: Select all
if chkSendReport.Checked then
begin
exceptIntf.SendInBackground := False;
exceptIntf.SendBugReport;
if Supports(exceptIntf, IMEExceptionEx, exceptIntfEx) AND not exceptIntfEx.GetMailWasSent then
begin
tmpDestPath := HMGetSpecialFolderPath(sfUserDocuments, 'Help And Manual BugReports', true);
tmpFileName := IncludeTrailingPathDelimiter(tmpDestPath) + 'bugreport-' + FormatDateTime('yyyymmdd-hhnnss-zzz', Now) + '.txt';
tmpImgFileName := IncludeTrailingPathDelimiter(tmpDestPath) + 'bugreport-' + FormatDateTime('yyyymmdd-hhnnss-zzz', Now) + '.png';
DebugString(tmpFileName, AnsiString(exceptIntf.BugReport), False, True);
exceptIntf.ScreenShot.SavePng(tmpImgFileName);
try
ShellExecute(0, nil, 'explorer.exe', PChar('/select,'+tmpFileName), nil, SW_SHOWNORMAL);
except end;
end;
end;
Thank you for help!
Best regards,
Michael