Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
I mapi, you mapi, he mapies, ...
Message
 
To
10/11/1997 12:57:37
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00058979
Message ID:
00059350
Views:
34
>>That is not true. I contacted MicroSoft twice about problems getting the MAPI controls going and they were VERY helpful. Right now, I have an executable at work that reads a text file downloaded from our website, processes registrations, and automatically emails the registrants a confirmation of registration. There are a couple of bugs in the control, but there are ways
>around them. Call and ask and you will get help.
>
>Are you willing to post that on the KB or perhaps E-mail steps and
>code.

Dan,

I am assuming you want me to post code or steps for using the MAPI controls?

The first step is to place one of each on the form. Name them something (I hate leaving controls or object with the default whatever1 type names). Then add some methods to your form to work with the controls.


To open a session, try something like:

WITH THISFORM.wrSession1
.LogonUI = .T. && bring up a logon dialog?
.NewSession = .T. && start a new Exchange session?
.signOn && sign on to the session!
ENDWITH

in your OpenSession( ) method. The comments should make this clear enough, but a little explanation:

You can cause the control to bring up a sign-on dialog. If you know the profile you intend to use, you can set this to false.
You can also force it to start a new messaging session, rather than use one that is already open. I think this is the better way.
The signOn method actually starts up the session.

Then, when you're ready to send the email, do something like this:

WITH THISFORM.wrMessaging1
.MsgIndex = -1
.RecipDisplayName = m.lcEmailAddress
.MsgSubject = m.lcEmailSubject
.MsgNoteText = m.lcEmailMessage
.SessionID = THISFORM.wrSession1.SessionID
.ResolveName
.Send(0)
ENDWITH

Take a look at the help file for the MAPI controls, it's in the CTRLHELP folder under VFP, and it's in the CTRLREF.HLP help file. Just look up each property or method listed above. Of course, you'll notice that there are several memory variables. the m.lcEmailMessage is actually from a memo field in a table. Bear in mind that the purpose in this case is to send a sort of Form Letter email. You may want to do something different, but the process is the same. You may read that you don't have to use the ResolveName method, but you do. This looks at the address and decides where to send the mail. For example, if the address has @ in it, it will know that it is an Internet address, not on the local network. You need to get the Sission ID from the Session control. It is automatically assigned when you signon.

Hope this has enlightened you. :)

Dana
Where's the damned Any Key?...too late
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform