PDA

View Full Version : Errors Sending Email


MikeM
01-Dec-2009, 09:35 PM
Hi,

I'm using Eurekalog 6.0.21, Windows 7 and Delphi 2010, and I have two separate problems when sending emails.

When I have the Email Send Mode set to Email Client, the email message window pops up and I can send the email, but the entire application crashes (no exception dialog) with a "fill.exe has stopped working (Windows is collecting more information...)" windows dialog. The email gets sent successfully, but the application just dies. I tracked the failure to the line
FMapiLogoff(hSession, ParentWnd, 0, 0);
in the finally of the InternalSendMail function. In case it matters, I'm using Outlook 2007 connected to an Exchange server.

If I try to use the SMTP Server option, it fails because the connection is being actively refused by the server, but the program shows the error message dialog (because showInternalErrors is on) but it never returns control to the program. After failing to open the socket, SetErrorType is called in the last Except block of SMTPSendSingleEmail, but control never returns from that function. The program just hangs there displaying the "Send. Message 1/1" progress dialog.


If you need any more information about either of these problems, please let me know.

Thanks,
Mike

Alex
02-Dec-2009, 09:14 AM
Hi,

The email gets sent successfully, but the application just dies. I tracked the failure to the line FMapiLogoff(hSession, ParentWnd, 0, 0);
This looks like an error in MAPI implementation :( Strange thing is that this is Outlook - there should not be such obvious bugs.
Unfortunately, I do not have Outlook 2007 at hand to check it :(
Can you export \SOFTWARE\Clients\Mail (in HKEY_CURRENT_USER and HKEY_LOCAL_MACHINE) keys and post it there? Can you also check this mode on other machines?

My machine has "Microsoft Outlook" selected with implementation in MAPI32.dll.

SetErrorType is called in the last Except block of SMTPSendSingleEmail
I believe that there should be an error message displayed (there is MessageBox call inside SetErrorType).

The program just hangs there displaying the "Send. Message 1/1" progress dialog.
May be this'll sound stupid, but try to find and close that error dialog, I mentioned above. May be it was covered by other windows.

Try also to set (undocumented) global variable ShowInternalSendErrors to False (ExceptionLog.pas unit).

BTW, do you use some "stay on top" options?

Alex
02-Dec-2009, 12:32 PM
Hi,

Try also to check this issue in the latest RC version, please.

MikeM
03-Dec-2009, 09:59 PM
Hi Alex,

I've attached the Reg settings from HKLM, but there wasn't a mail key under HKCU\Software\Clients.

For the second problem, you were correct. I forgot to mention that the message box appears indicating the error. But upon leaving the SetErrorType function in debug mode, the program hangs. I can't close the "Sending" dialog in any way. I tried turning off the ShowInternalSendErrors variable, and the error dialog does not appear, but the program still hangs. When I press F8 on the end; of SetErrorType, the program just hangs. (i.e. it does not go to the next code line, and the sending dialog stays on the screen). I tried this on another computer that is running XP (32-bit) with Outlook 2003, and the problem is the same. If the send errors out, the Sending dialog never goes away.

After further review, this will not be a problem for us because we will be using HTTP to send the log information.

Thanks,
Mike

Alex
04-Dec-2009, 09:12 AM
Hi,

About first issue: try to see these links
http://blogs.msdn.com/stephen_griffin/archive/2004/07/03/exchange-and-outlook-on-the-same-machine.aspx
http://support.microsoft.com/kb/813602
http://blogs.msdn.com/stephen_griffin/archive/2007/03/19/mapi-and-exchange-2007.aspx

About second issue:
Can you redporuce this in single application? May be not exactly under your conditions ("connection is being actively refused by the server"), but under some other?

If yes - then can you turn on "Use Debug DCUs" ("Compiler" page) and "Include TD32 Debug Info" ("Linker" page) options and make a build. Then send us this demo (sources, compiled exe, option and map files).