Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MAPI problems - Can NOT .SEND
Message
De
29/07/1997 15:20:44
Matt Mc Donnell
Mc Donnell Software Consulting
Boston, Massachusetts, États-Unis
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00042112
Message ID:
00042169
Vues:
35
>>>I have got a couple of MAPI related problems.
>>>1) What is the best resource on MAPI for VFP programmers?
>>>2) On Win95, I need to create a message and send it programmatically (no user intervention).
>>>I run the code below and get 'Invalid Callee' error. If I put .Send(1) it will work fine but
>>>it brings up your mail program.
>>> I also, want to do this on our Web server(NT 4.0 running IIS3.0) as a sort of auto responder.
>>>Again .send will not work but with a different error: OLE lDispatch exception Code 0 from MAPI32:
>>>Unspecified Error. That's real helpful. Another difference is that I can't get the message sent on
>>>the NT box no matter what .send I use (.send .send(1) .send(0) .send(-1) .send(2) ) I tried them all!
>>>
>>>Do I need to use the .DLL instead of the .OCX?
>>>
>>>The code is below.
>>>
>>>Thanks for any help,
>>>Brent
>>>brent.sliefert@usa.net
>>>Human Interface
>>>913-438-8717
>>>
>>>
>>>
>>>With ThisForm.MAPISession
>>> *.UserName = "MS Exchange"
>>> .NewSession = .T.
>>> .DownLoadMail = .F.
>>> .SignOn
>>> If .SessionID <=0
>>> MessageBox("Invalid Session ID Was Generated." + Chr(13) +;
>>> "Unable To Connect To Windows Messaging.", 0, "Error")
>>> RETURN
>>> EndIf
>>>EndWith
>>>
>>>With ThisForm.MAPIMessages
>>> .SessionID = ThisForm.MAPISession.SessionID
>>> .Compose
>>> .RecipIndex = 0
>>> .MsgIndex = -1
>>> .RecipType = 1
>>> .RecipDisplayName = "John Doe"
>>> .RecipAddress = "JDoe@xyz.com"
>>> .MsgSubject = "Any Subject"
>>> .AttachmentIndex = 0
>>> .AttachmentPosition = 0
>>> .AttachmentPathName = CurDir() + "ZipFile.zip"
>>> .AttachmentName = "ZipFile.zip"
>>> .Send
>>>EndWith
>>>ThisForm.MAPISession.SignOff
>>
>>if this is vfp5, try .send(.f.)
>>also check to make sure the display name is exactly the same as the alias in the address book.
>
>I forgot to mention that I had tried .f. and by chance I did have the display name exactly the same.
>I recompiled and tried again getting the helpful error: OLE lDispatch exception Code 0 from MAPI32:
>Unspecified Error.
>
>Any other suggestions?? I really appreciate your help.
>
>Brent


For non-visual messaging..you could use my EMAIL.PRG which is in the file section. It uses MAPI 1.0

HTH
Matt McDonnell
...building a better mousetrap with moldy cheese...
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform