Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MAPI
Message
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Re: MAPI
Miscellaneous
Thread ID:
00347538
Message ID:
00347582
Views:
19
A few points here. NewSession should be set to true before SignOn is called.
You don't need MsgIndex (this will be set to -1 by the Compose). MsgType, RecipIndex and RecipType don't need to be set for a standard mail. Your error is probably caused by using the RecipAddress - use the RecipDisplayName instead. I don't know why but this is the only way it works!?! There is no way of making it send, you will need to change the Client settings to do this. I don't know what the settings are either.

>HI
>My goal is to send email in background without window. I did some test with MAPI.vcx available at UT and I am not able to send email directly to the net. The mail stay in OutBox??? In this case, I try to use myself MSMAPI32.ocx with the coding below.
>My last problem is I got now an error message on the "Send" line as someting is missing???
>
>Do someone as an example code to send an email in background task like as follow?
>
>*Begin test code to send an email in background
>*In this example, I try to put all necessary code but I don't know
>*what I need exactly.
>
>LOCAL oForm
>oForm = CREATEOBJECT("form")
>oForm.ADDOBJECT("Session1","olecontrol","MSMAPI.mapiSession")
>oForm.ADDOBJECT("Message1","olecontrol","MSMAPI.mapiMessages")
>oForm.Session1.signon
>oForm.Session1.NewSession
>oForm.Message1.SessionID = oform.Session1.SessionID
>oForm.Message1.compose
>oForm.Message1.MsgIndex = -1
>oForm.Message1.MsgReceiptRequested = .T.
>oForm.Message1.msgsubject = "This is the subject"
>oForm.Message1.msgnotetext = "This is the note!"
>oForm.Message1.msgType = ""
>oForm.Message1.RecipIndex = 0
>oForm.Message1.RecipType = 1
>oForm.Message1.RecipAddress = "myEmail@address.com"
>oForm.Message1.Send(.f.)
>oForm.Session1.Signoff
>Release oForm
>*End test
>
>Regards,
>Michel Corbin
Nigel B Coates
NBC Software Services
Dublin, Ireland.
eMail: Nigel.Coates@NBCSoftware.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform