Search code examples
delphisendmapithunderbirdauthentication

Delphi: MAPILOGON ErrorCode 1


I tried with many versions of MAPISend, but I everytime got error in one place. The MAPILogon returns with errorcode 1.

dwRet := MapiLogon(Handle,
nil,
nil,
 MAPI_DIALOG or MAPI_NEW_SESSION,
0, @MAPI_Session);

I tried with "MAPISend component", this code:

http://prog.hu/tudastar/60044-6/Delphi-Email+csatolt+file+thunderbird.html

and 2 of others.

Interesting, that Acrobat Reader CAN use the MAPI with Attach to email function, and the "Send" "In Mail" context menu also working.

I don't understand why it isn't working, in my machine (Win7) it is working fine.

Then machines where I failed have WinXP OS, and they used Thunderbird.

What I can do to successfully logon into MAPI?

THanks: dd


Solution

  • I think I found the problem. The problem, that Delphi needs a Registry value named MAPI under "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Messaging Subsystem" If this not present, it send 1 error code to you what is the base of the confusion.

    This value must be string. The sysadmin wrote DWORD, and this caused the problem.

    Thanks for your help: dd