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!

How to bring out an Outlook email message pre-filled in

Usefull Functions & Procedures

How to bring out an Outlook email message pre-filled in

by  Mike Gagnon  Posted    (Edited  )
This was taken from the FoxPro 2.6 forum and modified slightly to add the "CC" and the body. It is low-level, so it should work in most versions of FoxPro (including 2.6)
Code:
email("mike@nowhere.com","boss@mycompany.com")
Function email
Lparameters cUrlto,cUrlcc
cFile = Sys(2023) + Sys(3) + '.URL'
If File(m.cFile)
	Erase (m.cFile)
Endif
nFh = Fcreate(m.cFile)
If m.nFh < 0
	Wait "Can't create a temporary file for the email" Window Nowait
	Return
Endif
= Fputs(m.nFh,'[InternetShortcut]')
= Fwrite(m.nFh,'URL=mailto:' + cUrlto)
= Fwrite(m.nFh,"?CC= &cUrlcc&Subject= Meet for lunch&Body=Please join me and the gang for lunch tomorrow")
= Fflush(m.nFh)
= Fclose(m.nFh)
Run /N2 Start &cFile
Return .T.
Endfunc

Mike Gagnon
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