<% '------------------------------------------------------------ ' Name: cdoSendEmail ' Description: ' Use CDO2000 to send an email message ' Parameters: ' strTo Type: String (Input) ' Desc: The email address to send the message to. ' strFrom Type: String (Input) ' Desc: The email address the message is from. ' strSubject Type: String (Input) ' Desc: The subject of the email. ' strBody Type: String (Input) ' Desc: The body of the email. ' ' Returns: 0: failure ' 1: success ' ' Notes : none ' Author/Date: chris-5/2/2001 ' Last Modified: '------------------------------------------------------------ function cdoSendEmail(strTo,strFrom,strSubject,strBody) cdoSendEmail = 0 dim objCDOEmailMsg, objCDOConfig set objCDOConfig = Server.CreateObject("CDO.Configuration") set objCDOEmailMsg = Server.CreateObject("CDO.Message") ret = cdoConfigureSMTP(objCDOConfig) with objCDOEmailMsg set .Configuration = objCDOConfig .To = strTo .From = strFrom .Subject = strSubject .TextBody = strBody .Send end with set objCDOConfig = nothing set objCDOEmailMsg = nothing cdoSendEmail = 1 end function '------------------------------------------------------------ ' Name: cdoConfigureSMTP ' Description: ' Configure CDO to use the correct mail server ' Parameters: ' objCDOConfig Type: CDO.Configuration object (Input, Output) ' Desc: Configures a CDO.Configuration object ' ' Notes : none ' Author/Date: chris-5/2/2001 ' Last Modified: '------------------------------------------------------------ function cdoConfigureSMTP(objCDOConfig) cdoConfigureSMTP = 0 dim objCDOConfigFields set objCDOConfigFields = objCDOConfig.Fields with objCDOConfigFields .Item(cdoSendUsingMethod) = cdoSendUsingPort .Item(cdoSMTPServer) = SMTP_SERVER .Item(cdoSMTPAuthenticate) = cdoAnonymous .Item(cdoSMTPConnectionTimeout) = 20 .Update end with cdoConfigureSMTP = 1 end function %>