0

I've got a legacy application that calls outlook using extended MAPI to send out emails. Outlook is quite unstable, doesnt run as a service and can't handle a lot of emails so I am searching for a way to have outlook replaced. If there is no third party solution I guess I will have to figure out how to create a MAPI dll that emulates what outlook's MAPI dll. I did some googling, found code that exports the 12 simple MAPI functions but very little info for extended MAPI. As far as possible, I prefer to use Delphi or Lazarus (which supports 64bit?) to create the dll. Is there some way I can use to capture the extended MAPI calls. Meanwhile I found some info on WINE docs - http://source.winehq.org/WineAPI/mapi32.html

Would appreciate any pointers. :)

Joshua
  • 1,709
  • 2
  • 24
  • 38

1 Answers1

2

Don't do that: MAPI is not just a dll, it ia set of providers (PST, Exchange, etc.) that plug in. Have you looked into the standalone version of MAPI? http://www.microsoft.com/download/en/details.aspx?DisplayLang=en&id=1004 It can be used from a service just fine. Also, if you are using Extended MAPI only, why are you trying to run Outlook in a service? While it is indeed cannot be used in a service, the MAPI system that most versions of Outlook install can be used in a service just fine.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • Thanks Dmitry, not sure if I understand your reply completely. The legacy software (a server application) uses Outlook to send out emails. Here's the system flow:- Legacy App --> MAPI --> Outlook --> SMTP Server. What I'm attempting to do is to do away with the Outlook portion. I need to emphasize that the purpose of Outlook on that server is only to send out Email to an external SMTP server. Outlook is otherwise not required. – Joshua Apr 25 '12 at 18:52
  • 1
    Why aren't you talking SMTP directly then? It's much more simple then messing with Exchange/outlook – whosrdaddy Apr 25 '12 at 21:20
  • Extended MAPI does not invoke Outlook, Outlook invokes MAPI. Do you mean Simple MAPI (which indeed goes through Outlook)? – Dmitry Streblechenko Apr 25 '12 at 22:32
  • @whosrdaddy - I don't have the source code to the legacy application. :) – Joshua Apr 26 '12 at 02:33
  • http://www.rapware.nl/ The author has done a great deal of work around MAPI with this library. –  Apr 26 '12 at 04:07
  • @SilentD - I've seen this product but it appears to be a MAPI client API - which is what the Legacy app probably uses to connect to Outlook. – Joshua Apr 26 '12 at 05:46
  • I just noticed that it is possible to install Extended MAPI by installing http://www.ureader.com/msg/14751223.aspx instead of Outlook. I presume I can then create a MAPI client that reads the emails in the Outbox of the MAPI store and then send out the emails via SMTP? Will that work? – Joshua Apr 27 '12 at 15:13
  • @Dmitry Streblechenko - Pls ignore my last comment! Ok, after playing with a few Delphi MAPI apps, I'm starting to have a clue how this works. The Legacy App calls MAPI to send email. The email goes into an "outbox". Next we run Outlook which reads the "outbox" by calling MAPI. So what I need is to create an application that reads the "outbox" in place of Outlook, and then send out the email via SMTP. If I'm right, now the question is how to create this MAPI app, preferably using Delphi, and the next question is whether the legacy app will work with ExchangeMapiCdo.EXE in place of Outlook. – Joshua Apr 27 '12 at 16:45
  • There's a license issue with the standalone MAPI client. It appears that it can only be used for exchange server. I guess we still need to install outlook. That is ok as long as the email is sent not by outlook. One of the reason why I don't want to use outlook is because it doesn't run as a service and can hang if there is lots of emails. – Joshua Apr 28 '12 at 11:39