Many have posted questions about MAPI & VFP. There are two methods of dealing with this issue. You can use Outlook Express or Outlook and this reference deals with Outlook Express. In fact, you can use any MAPI-compliant mail client program, such as Eudora, with this method. AOL probably supports it too; Anyone know about AOL, Juno, Pegasus or any other Email client's support for MAPI?

This example is based around a form that can act as a sending or a receiving operation. This form will need to have the ActiveX controls Session and Message identifed in the Controls section of VFP Options. See elsewhere on how to do that.

Your Init on the form will creat the object for the Session:

public lcCurdir
lcCurdir = sys(5) + curdir()
Thisform.Session1.signon && turns on OE if it is not already open.

You will use the lcCurdir to come back to, because these ActiveX controls will change your location on you!

This is very useful and goes farther than I have attempted yet. All I've tried to do is use MAPI to send messages from my applications. The trouble is that on some user's systems (who DO have Outlook or Outlook Express installed) MAPI doesn't work. (I'm still trying to get a better explanation of what DOES happen... it seems that an error window appears (not my ON ERROR routine) and displays the message it's trying to send... Hmmmm...Maybe it's the Send Email confirmation and a stupid user?). Is there a way to check if MAPI is going to work first? (I know, that's a big and unfocused question.... but, what SHOULD be checked before trying to use it?) - ?wgcs

For Outlook Express you must set it's option to be the Simple MAPI client. In OE4 this was a checkbox. In OE5 I can't find the equivalent, unless setting it as the "Default Mail Handler" also sets it as the MAPI client. -- ?df

This'll work locally, but what about each of our users? (basically, MAPI was so easy to implement (it worked on the first try in development) that we wanted to use it for bug reporting... if the application hits an error it doesn't expect, a standard error handler collects LIST STATUS/LIST MEMORY/Call stack information and emails back to us... however it sometimes doesn't work. How can it (the program/error handler) tell if MAPI's going to work before trying it? - ?wgcs

Tom Koch (MS MVP Outlook Express) has some interesing OE stuff on his webpage. -- Cindy Winegarden
This looks great for what I want, but my users are not using Outlook or OE. Just one that uses simple MAPI. And I can not find the ActiveX controls Session and Message talked about above. I found one called Messageview, but nothing for session. Can someone point me to a class with these in them, or where the controls may be hiding. And how to get them on to the form? I suspect that you have to build the form after checking those controls and saving them. - Beth Walsh
"MAPI Bad... SMTP Good" from Ted Roche's "Email Without Outlook" 2002 presentation at http://www.tedroche.com/Present/2002/emailwooutlook.html
That is all fine and dandy. But my clients are using a email system that uses simple MAPI and they will not change just because I ask them to. Thanks for the info anyway. - Beth Walsh
Regarding MAPI clients, don't bother trying with Lotus Notes 5 or later. They don't support extended MAPI and you should use their own API. -- Alan Bourke I've written a series of entries on my blog regarding email and VFP that includes sample code. The first entry deals with MAPI: Email and VFP: Part 1a (MAPI) -- Craig SBoyd
See Also: Automated Email