%
Select Case Session("MailComponent")
'**CDONTS
'------------------------------------------------------------------------------------------
Case "Cdonts"
Dim objCdonts
Set objCdonts = CreateObject("CDONTS.NewMail")
With objCdonts
.Value("Reply-To")= Session("ReplytoEmail")
.From = Session("SiteName") & " <" & Session("AdminEmail") & ">"
If Request("fld_test") = 1 Then
.To = Session("TestEmail")
.Subject = "Test Email Sent By Admin"
Else
.To = rs("email")
.Subject = strsentsubject
End If
If strattach = 1 Then
strFile = Split(strattachment,",")
strCount = Ubound(strFile)
For i = 0 to strCount
.AttachFile(Session("ScriptPath") & "\attachments\" & strFile(i))
Next
End If
If strformat = "html" Then
.Body = strsentmessage
.BodyFormat = 0
.MailFormat = 0
Else
.Body = strsentmessage
End If
.Send
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
End With
Set objCdonts = Nothing
'** W3JMAIL
'--------------------------------------------------------------------------------------------
Case "w3Jmail"
Dim objJmail
Set objJmail = Server.CreateObject("JMail.SMTPMail")
With objJmail
.ServerAddress = Session("MailServer") & ":" & Session("MailServerPort")
.ISOEncodeHeaders = True
.ReplyTo = Session("ReplytoEmail")
.Sender = Session("AdminEmail")
.SenderName = Session("SiteName")
If Request("fld_test") = 1 Then
.Subject = "Test Email Sent By Admin"
Else
.Subject = strsentsubject
End If
If strattach = 1 Then
strFile = Split(strattachment,",")
strCount = Ubound(strFile)
For i = 0 to strCount
.AddAttachment(Session("ScriptPath") & "\attachments\" & strFile(i))
Next
End If
If Request("fld_test") = 1 Then
.AddRecipient Session("TestEmail")
Else
.AddRecipient rs("email")
End If
If strformat = "html" Then
.ContentType="text/html"
.Body = strsentmessage
Else
.Body = strsentmessage
End If
.Execute
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
End With
Set objJmail = nothing
'** ASPEMAIL
'-----------------------------------------------------------------------------------------------
Case "ASPemail"
Dim objASPemail
Set objASPemail = Server.CreateObject("Persits.MailSender")
With objASPemail
.Host = Session("MailServer")
.Port = Session("MailServerPort")
.AddReplyTo Session("ReplytoEmail")
.From = Session("AdminEmail")
.FromName = Session("SiteName")
If Request("fld_test") = 1 Then
.AddAddress Session("TestEmail")
Else
.AddAddress rs("email")
End If
If strattach = 1 Then
strFile = Split(strattachment,",")
strCount = Ubound(strFile)
For i = 0 to strCount
.AddAttachment(Session("ScriptPath") & "\attachments\" & strFile(i))
Next
End If
If Request("fld_test") = 1 Then
.Subject = "Test Email Sent By Admin"
Else
.Subject = strsentsubject
End If
If strformat = "html" Then
.Body = strsentmessage
.IsHTML = True
Else
.Body = strsentmessage
End If
.Send
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
End With
Set objASPemail = nothing
'** ASPMAIL
'------------------------------------------------------------------------------------------------
Case "ASPMail"
Dim objASPMail
Set objASPMail = Server.CreateObject("SMTPsvg.Mailer")
With objASPMail
.RemoteHost = Session("MailServer") & ":" & Session("MailServerPort")
.ReplyTo = Session("ReplytoEmail")
.FromName = Session("SiteName")
.FromAddress= Session("AdminEmail")
If Request("fld_test") = 1 Then
.AddRecipient Session("TestEmail"), Session("TestEmail")
Else
.AddRecipient rs("email"), rs("email")
End If
If strattach = 1 Then
strFile = Split(strattachment,",")
strCount = Ubound(strFile)
For i = 0 to strCount
.AddAttachment(Session("ScriptPath") & "\attachments\" & strFile(i))
Next
End If
If Request("fld_test") = 1 Then
.Subject = "Test Email Sent By Admin"
Else
.Subject = strsentsubject
End If
If strformat = "html" Then
.ContentType = "text/html"
.BodyText = strsentmessage
Else
.BodyText = strsentmessage
End If
.SendMail
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
End With
Set objASPMail = nothing
'** DUNDASMAILER
'-----------------------------------------------------------------------------------------------------
Case "DundasMailer"
Dim objDundasMailer
Set objDundasMailer = Server.CreateObject("Dundas.Mailer")
With objDundasMailer
.ReplyTOs.Add Session("ReplytoEmail")
If Request("fld_test") = 1 Then
.TOs.Add Session("TestEmail")
Else
.TOs.Add rs("email")
End If
If strattach = 1 Then
strFile = Split(strattachment,",")
strCount = Ubound(strFile)
For i = 0 to strCount
.Attachments.Add(Session("ScriptPath") & "\attachments\" & strFile(i))
Next
End If
If Request("fld_test") = 1 Then
.Subject = "Test Email Sent By Admin"
Else
.Subject = strsentsubject
End If
.FromAddress = Session("AdminEmail")
.FromName = Session("SiteName")
.SMTPRelayServers.Add Session("MailServer"),Session("MailServerPort")
If strformat = "html" Then
.HtmlBody = strsentmessage
Else
.Body = strsentmessage
End If
.SendMail
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
End With
Set objDundasMailer = nothing
'** CDOSYS
'-------------------------------------------------------------------------------------------------------
Case "CDOSYS"
Dim Flds, iConf, CDOSYS
Set CDOSYS = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject ("CDO.Configuration")
Set Flds = iConf.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = Session("MailServer")
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport")= Session("MailServerPort")
.Update
End With
Set CDOSYS.Configuration = iConf
Set Flds = CDOSYS.Fields
With CDOSYS
.From = Session("SiteName") & " <" & Session("AdminEmail") & ">"
.ReplyTo = Session("ReplytoEmail")
If Request("fld_test") = 1 Then
.To = Session("TestEmail")
Else
.To = rs("email")
End If
If Request("fld_test") = 1 Then
.Subject = "Test Email Sent By Admin"
Else
.Subject = strsentsubject
End If
If strattach = 1 Then
strFile = Split(strattachment,",")
strCount = Ubound(strFile)
For i = 0 to strCount
.AddAttachment(Session("ScriptPath") & "\attachments\" & strFile(i))
Next
End If
If strformat = "html" Then
.HTMLBody = strsentmessage
Else
.TEXTBody = strsentmessage
End If
.Send
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
End With
Set CDOSYS = nothing
'** ASPSMARTMAIL
'-----------------------------------------------------------------------------------------------------
Case "aspSmartMail"
Dim aspSmartMail
Set aspSmartMail = Server.CreateObject("aspSmartMail.SmartMail")
With aspSmartMail
.Server = Session("MailServer")
.ServerPort = Session("MailServerPort")
.SenderName = Session("SiteName")
.SenderAddress = Session("AdminEmail")
If Request("fld_test") = 1 Then
.Recipients.Add Session("TestEmail")
Else
.Recipients.Add rs("email")
End If
.ReplyTos.Add Session("ReplytoEmail")
If Request("fld_test") = 1 Then
.Subject = "Test Email Sent By Admin"
Else
.Subject = strsentsubject
End If
If strattach = 1 Then
strFile = Split(strattachment,",")
strCount = Ubound(strFile)
For i = 0 to strCount
.Attachments.Add(Session("ScriptPath") & "\attachments\" & strFile(i)), False
Next
End If
.Body = strsentmessage
If strformat = "html" Then
.ContentType = "text/html"
Else
.ContentType = "text/plain"
End If
.SendMail
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
End With
set aspSmartMail = nothing
'** ACTIVE EMAIL
'---------------------------------------------------------------------------------------------------------------
Case "ActiveEmail"
Dim ActiveEmail
Set ActiveEmail = Server.CreateObject("ActivXperts.SmtpMail")
With ActiveEmail
.HostName = Session("MailServer")
.HostPort = Session("MailServerPort")
.FromAddress = Session("AdminEmail")
.FromName = Session("SiteName")
.ReplyAddress = Session("ReplytoEmail")
If Request("fld_test") = 1 Then
.AddTo Session("TestEmail"), ""
Else
.AddTo rs("email"), ""
End If
If Request("fld_test") = 1 Then
.Subject = "Test Email Sent By Admin"
Else
.Subject = strsentsubject
End If
If strformat = "html" Then
.BodyType = 1
.Body = strsentmessage
Else
.Body = strsentmessage
End If
If strattach = 1 Then
strFile = Split(strattachment,",")
strCount = Ubound(strFile)
For i = 0 to strCount
.AddAttachment(Session("ScriptPath") & "\attachments\" & strFile(i))
Next
End If
.Send
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
End With
Set ActiveEmail = nothing
'** SOFTARTISANS
'--------------------------------------------------------------------------------------------------
Case "SoftArtisans"
Dim SoftArtisans
Set SoftArtisans = Server.CreateObject("SoftArtisans.SMTPMail")
With SoftArtisans
.RemoteHost = Session("MailServer")
.Port = Session("MailServerPort")
.FromName = Session("SiteName")
.FromAddress = Session("AdminEmail")
If Request("fld_test") = 1 Then
.AddRecipient "" , Session("TestEmail")
Else
.AddRecipient "" , rs("email")
End If
If Request("fld_test") = 1 Then
.Subject = "Test Email Sent By Admin"
Else
.Subject = strsentsubject
End If
If strattach = 1 Then
strFile = Split(strattachment,",")
strCount = Ubound(strFile)
For i = 0 to strCount
.AddAttachment strattachment
Next
End If
.BodyText = strsentmessage
If strformat = "html" Then
.ContentType = "text/html"
Else
.ContentType = "text/plain"
End If
.ReplyTo = Session("ReplytoEmail")
.SendMail
If err <> 0 Then
Response.Write""
err.clear
Response.End
End If
End With
Set SoftArtisans = nothing
End Select
%>