Use cdosys.pkg Use msado26.pkg Object oADOField is a cComField End_Object Object oADOFields is a cComFields End_Object Object oCDOConfiguration is a cComConfiguration Procedure OnCreate Variant vFields vItem Forward Send OnCreate Get ComFields to vFields Set pvComObject of (oADOFields(Self)) to vFields Get ComItem of (oADOFields(Self)) "http://schemas.microsoft.com/cdo/configuration/sendusing" to vItem Set pvComObject of (oADOField(Self)) to vItem Set ComValue of (oADOField(Self)) to OLEcdoSendUsingPort Get ComItem of (oADOFields(Self)) "http://schemas.microsoft.com/cdo/configuration/smtpserver" to vItem Set pvComObject of (oADOField(Self)) to vItem Set ComValue of (oADOField(Self)) to (Trim(System.Mail_Server)) // system.mail_server contains an smtp server name Get ComItem of (oADOFields(Self)) "http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout" to vItem Set pvComObject of (oADOField(Self)) to vItem Set ComValue of (oADOField(Self)) to 10 // seconds If (Trim(System.Mail_User) = "") Begin // system.mail_user contains a user name, or nothing for anonymous sending Get ComItem of (oADOFields(Self)) "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" to vItem Set pvComObject of (oADOField(Self)) to vItem Set ComValue of (oADOField(Self)) to OLEcdoAnonymous End Else Begin Get ComItem of (oADOFields(Self)) "http://schemas.microsoft.com/cdo/configuration/smtpauthenticate" to vItem Set pvComObject of (oADOField(Self)) to vItem Set ComValue of (oADOField(Self)) to OLEcdoBasic Get ComItem of (oADOFields(Self)) "http://schemas.microsoft.com/cdo/configuration/sendusername" to vItem Set pvComObject of (oADOField(Self)) to vItem Set ComValue of (oADOField(Self)) to (Trim(System.Mail_User)) Get ComItem of (oADOFields(Self)) "http://schemas.microsoft.com/cdo/configuration/sendpassword" to vItem Set pvComObject of (oADOField(Self)) to vItem Set ComValue of (oADOField(Self)) to (Trim(System.Mail_Pass)) // system.mail_pass contains a plaintext password for the smtp server End Get ComItem of (oADOFields(Self)) "http://schemas.microsoft.com/cdo/configuration/smtpusessl" to vItem Set pvComObject of (oADOField(Self)) to vItem Set ComValue of (oADOField(Self)) to (False) // Set this to true if you get errors about STARTTLS Send ReleaseComObject to (oADOField(Self)) Send ComUpdate to (oADOFields(Self)) Send ReleaseComObject to (oADOFields(Self)) End_Procedure // OnCreate End_Object // oCDOConfiguration Object oCDOMessage is a cComMessage Property String psTo Public "" Property String psFrom Public "" Property String psSubject Public "" Property String psHTMLBody Public "" Procedure OnCreate Forward Send OnCreate // Configuration Send CreateComObject to (oCDOConfiguration(Self)) If (Not(IsComObjectCreated(oCDOConfiguration(Self)))) Begin Send LogEvent 91102 "Unable to create CDO.Configuration object" End Set ComConfiguration to (pvComObject(oCDOConfiguration(Self))) Set ComAutoGenerateTextBody to True Set ComTo to (psTo(Self)) Set ComFrom to (psFrom(Self)) Set ComSubject to (psSubject(Self)) Set ComHTMLBody to (psHTMLBody(Self)) End_Procedure // OnCreate End_Object // oCDOMessage