Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
E-mail from VFP6?
Message
 
 
À
27/12/2000 01:00:52
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00456980
Message ID:
00457332
Vues:
23
>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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform