<% Function SendMail(strToEmail, strFromEmail, strSubject, strEmailBody) Dim CDONTS, CDOSYS, Jmail, AspEmail, AspMail Select Case strMailObject 'If CDONTS Mail Component Then Case "CDONTS" 'Create mail object Set CDONTSMail = CreateObject("CDONTS.NewMail") CDONTSMail.From = " <" & strFromEmail & ">" CDONTSMail.To = "<" & strToEmail & ">" CDONTSMail.Subject = strSubject CDONTSMail.Body = strEmailBody CDONTSMail.BodyFormat = 1 '(email body format - 0=HTML, 1=Text) CDONTSMail.MailFormat = 0 '(mail format - 0=MINE 1=Text) CDONTSMail.Importance = 1 '(mail priority 0=Low, 1=Normal, 2=High) CDONTSMail.Send Set CDONTSMail = Nothing 'If CDOSYS Mail Component Then Case "CDOSYS" 'Dimension variables Dim CDOSYSMail 'Create mail object Set CDOSYSMail = Server.CreateObject("CDO.Message") Set ConfCDOSYSMail = Server.CreateObject ("CDO.Configuration") 'set the CDOSYS configuration fields ConfCDOSYSMail.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strSMTPServer ConfCDOSYSMail.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 ConfCDOSYSMail.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 ConfCDOSYSMail.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60 ConfCDOSYSMail.Fields.Update Set CDOSYSMail.Configuration = ConfCDOSYSMail CDOSYSMail.From = "<" & strFromEmail & ">" CDOSYSMail.To = "<" & strToEmail & ">" CDOSYSMail.Subject = strSubject 'CDOSYSMail.HTMLBody = strEmailBody CDOSYSMail.TextBody = strEmailBody If strSMTPServer <> "" Then CDOSYSMail.Send End If Set CDOSYSMail = Nothing 'If JMail Component Then Case "Jmail" 'Create mail object Set JMail = Server.CreateObject("JMail.SMTPMail") 'Out going SMTP mail server address JMail.ServerAddress = strSMTPServer JMail.Sender = strFromEmail JMail.AddRecipient strToEmail JMail.Subject = strSubject JMail.Body = strEmailBody 'JMail.HTMLBody = strEmailBody JMail.Priority = strImportance '3 If strSMTPServer <> "" Then JMail.Execute End If Set JMail = Nothing 'If AspEmail Component Then Case "AspEmail" 'Create mail object Set AspEmail = Server.CreateObject("Persits.MailSender") AspEmail.Host = strSMTPServer AspEmail.From = strFromEmail AspEmail.AddAddress strToEmail AspEmail.Subject = strSubject 'AspEmail.IsHTML = True '(set mail body format to HTML) AspEmail.Body = strEmailBody If strSMTPServer <> "" Then AspEmail.Send End If Set AspEmail = Nothing 'If AspMail Component Then Case "AspMail" 'Create mail object Set AspMail = Server.CreateObject("SMTPsvg.Mailer") AspMail.RemoteHost = strSMTPServer AspMail.FromAddress = strFromEmail AspMail.AddRecipient " ", strToEmail AspMail.Subject = strSubject 'AspMail.ContentType = "text/html" '(set mail body format to HTML) AspMail.BodyText = strEmailBody If strSMTPServer <> "" Then AspMail.SendMail End If Set AspMail = Nothing 'If No Mail Object is specified Then Set CDONTS as Default Case Else 'Create mail object Set CDONTSMail = CreateObject("CDONTS.NewMail") CDONTSMail.From = " <" & strFromEmail & ">" CDONTSMail.To = "<" & strToEmail & ">" CDONTSMail.Subject = strSubject CDONTSMail.Body = strEmailBody CDONTSMail.BodyFormat = 1 '(email body format - 0=HTML, 1=Text) CDONTSMail.MailFormat = 0 '(mail format - 0=MINE 1=Text) CDONTSMail.Importance = 1 '(mail priority 0=Low, 1=Normal, 2=High) CDONTSMail.Send Set CDONTSMail = Nothing End Select End Function %>