General information
Category:
Internet applications
If you use the Outlook automation object model, you can use the following
piece of code to send an e-mail from foxpro 5.0
oSession = Create('Mapi.Session')
oSession.Logon() && Specify the a profile name to skip the dialogue
oMessage = oSession.OutBox.Messages.Add()
oMessage.Subject = ''
oMessage.Text = ''
oRecipient = oMessage.recipients.add()
oRecipient.Name='' && e-mail address
oRecipient.Type = 1 && (1= send to , 2 = cc line , 3 = Bcc line)
omessage.send(.t.,.f.) && .t. to save message, .f. to suppress visual dialogue
oSession.DeliverNow() && immediate delivery of all undelivered messages
- Chris
>>I Have 48 hours to come up with a way for a FoxPro Application to be able to
>>send and receive E-mail.
>>
>>Does anyone know what the best method of doing this would be?
>
>One way would be to have FoxPro access Outlook or Exchange client through OLE automation. There's a help file on the Office '97 or Outlook CD that has information about the Outlook object model. You would need to have Outlook running on the same machine as VFP and receiving mail. It would be fairly easy to send and read the mail from VFP. If you just need to send mail, check out SENDMAIL.SCX in the VFP\SAMPLES\SOLUTION\OLE directory. It has an example of sending mail using the two MAPI ActiveX controls that come with VFP.
>
>Good luck!
>
>Josh
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only