Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I send an Email using OUTLOOK from VFP?

COM and Automation

How can I send an Email using OUTLOOK from VFP?

by  ramani  Posted    (Edited  )
**********************************************************
** How can I send an Email using OUTLOOK from VFP
**********************************************************
** by Subramanian.G (ramani)
** FoxAcc Software
** ramani_g@yahoo.com
**********************************************************
1. Outlook (2000 or 98 or 97) must be installed for this to work.

2. Save the following in a command button click event .. so that when you click this will be sent as an email
Or Save as prg file and run the file to send the email.

**********************************************************
o=createobject("outlook.application")
oitem=o.createitem(0)
oitem.subject="Email From VFP6"

oitem.to="ramani_g@yahoo.com"
** To send copy to addresses..
oItem.cc = "address1@someNet.com;address2@somenet.com"

oitem.body="This mail was sent from vfp using Outlook98"

** To attach a file
oitem.Attachments.Add("MyFullPath+MyFile+Ext")
** to attach one more file.. and you can repeat this.
oitem.Attachments.Add("MyFullPath+MyFile+Ext")

** to send it
oitem.send

** to clear up
o=.null.
**********************************************************
** EOF **
Ramani (Subramanian.G), FoxAcc, ramani_g@yahoo.com
**********************************************************
Evaluate this to make others know how useful is this :-)
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top