| How to send e-mail from visual foxpro 9.0 without opening outlook |
|
Look at CDO for Windows 2000 and later. To send messages, you must have network or local access to an SMTP or NNTP service. You must also have CdoSys.dll and Microsoft ActiveXR Data Objects (ADO) 2.5 installed. CDO for Windows 2000 is fully integrated with ADO, providing a consistent interface for managing the data that comprises a message. (Note that ADO is installed by default with Windows 2000, but CDO is an optional item).
*** create configuration and message objects
loConfig = CREATEOBJECT( 'CDO.Configuration' )
loMsg = CREATEOBJECT( 'CDO.Message' )
LPARAMETERS toParms
# DEFINE cdoSendEmailAddress "http://schemas.microsoft.com/cdo/configuration/sendemailaddress"
LOCAL lnCnt, lnLen
WITH loMsg
.Configuration = loConfig
.Configuration.Fields( cdoSendEmailAddress ).value =
.To = ALLTRIM( toParms.cTo )
. CC = ALLTRIM( toParms.cCC )
. Bcc = ALLTRIM(toParms.cBcc )
. Subject = ALLTRIM( toParms.cSubject )
*** Add any message text to the beginning of the body
.HTMLBody = [This is a test.]
.Send()
ENDWITH
|