Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Auto Sending of Email with Subject and Message
Message
De
20/11/2001 07:23:08
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Fonctions Windows API
Divers
Thread ID:
00583832
Message ID:
00583838
Vues:
20
This message has been marked as a message which has helped to the initial question of the thread.
Chris,
I don't know about ShellExecute, but if you're using Outlook, you could use automation:
loApp = CreateObject("Outlook.Application")

loMapi = loApp.GetNameSpace("MAPI")
loMailItem = loApp.CreateItem(0)

WITH loMailItem
	.Recipients.Add(tcRecipient) && address
	.Subject = tcSubject
	.Body    = tcMessage
	
	*-- check if there's an attachment
	IF NOT EMPTY(tcAttachment) AND FILE(tcAttachment)
		.Attachments.Add(tcAttachment)
	ENDIF
	
	.Send

ENDWITH

loMapi.Logoff
Alternatively, you could use the MAPI OCX that ships with VFP. There are classes available for download. Another solution is to use SMTP. Check the following message #583757

HTH
>Hi - I am currently using the following (Sorry if this isn't Windows API!) to launch a blank email message with no subject...
>
>DECLARE INTEGER ShellExecute IN SHELL32.DLL ;
> INTEGER nWinHandle, STRING cOperation,;
> STRING cFileName, STRING cParameters,;
> STRING cDirectory, INTEGER nShowWindow
>ShellExecute(0, "", "mailto:" + lcEmail, "", "",1)
>
>Is there a way to specify a subject and message and get the email message to go straight into the Outbox rather than appear on screen waiting to be sent?
>
>Thanks for any comments...
Daniel
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform