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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending HTML email using Outlook from VFP

COM and Automation

Sending HTML email using Outlook from VFP

by  itflash  Posted    (Edited  )
I needed to create an email which looks like a web page. So this is what this example lets you do.


Very simple, based on ramani's example.

Create a form with a command button.
On the click event of the command button, place the following code.

o=createobject("outlook.application")
oitem=o.createitem(0)
oitem.subject="Email From VFP6"
oitem.to="flash@whereever.co.uk"
oitem.htmlbody="<HTML><H2>My HTML page.</H2><BODY>My body.</BODY></HTML>"
oitem.send
o=.null.


Therefore, the htmlbody is what you set to contain your HTML code.


One thing to note:
If you set the oitem.body, it will wipe the oitem.htmlbody




Rate it and I may get my first vote! [surprise]
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