Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Auto Sending of Email with Subject and Message
Message
From
20/11/2001 07:23:08
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00583832
Message ID:
00583838
Views:
18
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
Previous
Reply
Map
View

Click here to load this message in the networking platform