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

durumdara
  • 3,411
  • 4
  • 43
  • 71
  • 2
    Are you sure that Thunderbird is registered correctly? Some info about TB and MAPI is here: http://kb.mozillazine.org/index.php?title=MAPI_Support&printable=yes – Jens Mühlenhoff Sep 06 '10 at 13:08

4 Answers4

5

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

durumdara
  • 3,411
  • 4
  • 43
  • 71
1

I am using RapWare components, http://www.rapware.nl/

Hth's.

Stanko.

1

I found you may also have to add the MAPI string value of 1 in two places:

  1. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows Messaging Subsystem
  2. HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows Messaging Subsystem

The latter for 32bit apps running on 64bit Windows:

I didn't need this for using the Jedi tools SendMail in D2007 but did for using LMDTool's SendMail in Delphi 10+ (probably even for Delphi XE and later I assume).

0

I'm not sure about any Delphi-specific issues, but you don't need to call MAPILogon before calling MAPISendMail. If you do, I wouldn't check the return value. That's why Acrobat Reader was working and your SMAPI client was not.