Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Send / Receive E-mail using FoxPro 5
Message
From
15/11/1997 00:19:07
Christopher Holtz
Integral Computer Services, Inc.
Rochester, New York, United States
 
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
00060371
Message ID:
00060409
Views:
35
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
Map
View

Click here to load this message in the networking platform