Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
E-mail from VFP6?
Message
From
28/12/2000 10:19:04
 
 
To
27/12/2000 01:00:52
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00456980
Message ID:
00457332
Views:
22
>How would I send an e-mail (& attachment) automatically from VFP6. I found a simple prg that uses Microsoft Exchange, but I don't have Exchange!

If you have Outlook, you can do:
lparameters tcAddress, tcSubject, tcBody

loApplication = CreateObject( "Outlook.Application" )

if varType( .oApplication ) = "O"
	
	* Creates a pointer to MAPI namespace
	.oMapiSpace = .oApplication.GetNameSpace( "MAPI" )
	
	* Creates a pointer to the Inbox (default folder #6)
	.oInbox = .oMapiSpace.GetDefaultFolder( 6 )
	
	loNew = .oInbox.Items.Add()
	
	loNew.Recipients.Add( tcAddress )
	loNew.Subject = tcSubject
	
	loNew.HTMLBody = tcBody
	loNew.Send()
endif
The code is overly simplified. You should convert it to a generic class. It is based in a series of articles by Andy McNeal in FoxPro Advisor (around july/september 2000) on controling Outlook form VFP and callig VFP code from Outlook.

Hope this helps.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform