Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MAPI Problem
Message
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Title:
Miscellaneous
Thread ID:
00859160
Message ID:
00859177
Views:
13
Kevin,

Make sure that signon was successful by checking for 'oSession.SessionID > 0'. Keep in mind that MAPI UserName is the name of a profile not a user.


>In the following code, I'm getting an "Unspecified error occured"
>on the line oMessages.Send()
>
>Anyone know what's wrong here?
>
>
>
>cLoginName = "loginname"
>cPassword = "password"
>cRecipient = "kmarois@comcast.net"
>cSubject = "Test Email"
>cBody = "This is a test
>*cAttachment = "d:\projects\vfp1\email\test.txt"
>
>
>oSession = CREATEOBJECT("MSMAPI.MAPISession")
>oMessages = CREATEOBJECT("MSMAPI.MAPIMessages")
>
>WITH oSession
>  .DownLoadMail = .T. 								
>  .LogonUI= .F.
>  .UserName = cLoginName
>  .Password = cPassword
>  .SignOn()
>ENDWITH
>
>
>oMessages.SessionID = oSession.SessionID
>oMessages.Compose()
>oMessages.RecipAddress = cRecipient
>oMessages.MsgSubject = cSubject
>oMessages.MsgNoteText = cBody
>oMessages.Send(.T.)
>
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform