lparameters tcTo, tcCC, tcBCC, tcFrom, tcSender, tcSubject, tcBody, tcAttachments, tlBodyIsHTML local loConfiguration, loConfFields, loCDOMessage, llResult, laWord[1], x llResult = .t. *** Create and use the Microsoft Collaboration Data Objects (CDO) to send the email *** CDO 1.2 was first available with Microsoft Exchange 5.5 and Windows NT® version 4. *** As of December 2003, CDO 1.2.1 is provided in Microsoft Outlook 98 and 2000. *** CDO 1.2.1 is also provided in Windows 2000 and Exchange 2000 for backwards compatibility. loConfiguration = createobject("CDO.Configuration") if type("loConfiguration") <> "O" *- could not create Configuration object return .f. endif loCDOMessage = createobject("CDO.Message") if type("loCDOMessage") <> "O" *- could not create CDO Message object return .f. endif loConfFields = loConfiguration.fields With loConfFields .Item(cdoSMTPServer) = this.cSMTPServer .Item(cdoSendUsingMethod) = cdoSendUsingPort *** Extra SMTP Server settings that may be needed if your SMTP server require a username and password * Incoming Port = 110, Outgoing Port = 25 *!* .Item(cdoSMTPServerPort) = 25 *!* .Item(cdoSMTPAuthenticate) = cdoBasic *!* .Item(cdoSMTPAccountName) = "JoeShmo" *!* .Item(cdoSendUserName) = "JoeShmo" *!* .Item(cdoSendPassword) = "*****" *!* .Item(cdoSendEmailAddress) = "JoeShmo@yourcompany.com" .Update Endwith With loCDOMessage .Configuration = loConfiguration *- Multiple addresses are designated with a comma-separated list .To = tcTo .CC = tcCC .BCC = tcBCC .From = tcFrom .Sender = tcSender .Subject = tcSubject *- Turn Message Disposition Notification ON to receive a Return Receipt for the email *- Actually, leave this off until we decide we will do something with return receipts *.MDNRequested = .t. *- Add body as either HTML or Plain Text if tlBodyIsHTML .AutoGenerateTextBody = .t. .HTMLBody = tcBody else .MimeFormatted = .f. .Textbody = tcBody endif *- Add Attachments to email llResult = .AddAttachment("C:\Test\Test.txt") llResult = .Send Endwith loCDOMessage = null loConfiguration = null loConfFields = null return llResult