Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to send email?
Message
 
To
14/12/2001 08:32:25
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00591486
Message ID:
00594348
Views:
33
Marcia, thanks! I had used CDONTS extensively with VFP web apps, but, your CDO example should work well without IIS SMTP (I think...).
>Hi Claude.
>
>>> Gerald, thanks! Is there any VFP code for that here on the UT or MS knowledge base for a simple example calling CDO from VFP. From what I've seen, it's a little more complicated than using CDONTS... <<
>
>This should help to get you started if you are planning to use CDO for Windows 2000 (cdosys.dll) The parameter object has properties populated for recipient lists, message body, etc.:
>
>
>LPARAMETERS toParms
>LOCAL lnCnt, lnLen
>
>*** create configuration and message objects
>loConfig = CREATEOBJECT( 'CDO.Configuration' )
>loMsg = CREATEOBJECT( 'CDO.Message' )
>WITH loMsg
>  .Configuration = loConfig
>  .To = ALLTRIM( toParms.cTo )
>  .CC = ALLTRIM( toParms.cCC )
>  .Bcc = ALLTRIM(toParms.cBcc )
>  .Subject = ALLTRIM( toParms.cSubject )
>  *** See if we are sending a web page in the body of the message
>  IF NOT EMPTY( toParms.cURL )
>    .CreateMHTMLBody( ALLTRIM( toParms.cURL ) )
>  ENDIF
>  *** Add any message text to the beginning of the body
>  .HTMLBody = toParms.cHTMLBody + .HTMLBody
>  *** Add any attachments
>  IF NOT EMPTY( toParms.aAttachments[ 1 ] )
>    lnLen = ALEN( toParms.aAttachments, 1 )
>    FOR lnCnt = 1 TO lnLen
>      .AddAttachment( ALLTRIM( toParms.aAttachments[ lnCnt ] ) )
>    ENDFOR
>  ENDIF
>  .Send()
>ENDWITH
>
Previous
Reply
Map
View

Click here to load this message in the networking platform