[l]
'Function to send an e-mail
Function SendMail(strEmailBody, strEmailAddress, strSubject, strMailComponent)
'Dimension variables
Dim objCDOMail 'Holds the CDONTS mail object
Dim objJMail 'Holds the Jmail object
'Select which email component to use
Select Case strMailComponent
'CDONTS mail component
Case "CDONTS"
'Create the e-mail server object
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
'Who the e-mail is from
objCDOMail.From = ""
'Who the e-mail is sent to
objCDOMail.To = ""
'The subject of the e-mail
objCDOMail.Subject = strSubject
'The main body of the e-amil
objCDOMail.Body = strEmailBody
'Set the e-mail body format (0=HTML 1=Text)
objCDOMail.BodyFormat = 1
'Set the mail format (0=MIME 1=Text)
objCDOMail.MailFormat = 0
'Importance of the e-mail (0=Low, 1=Normal, 2=High)
objCDOMail.Importance = 1
'Send the e-mail
objCDOMail.Send
'Close the server mail object
Set objCDOMail = Nothing
'JMail component
Case "Jmail"
'Create the e-mail server object
Set objJMail = Server.CreateObject("JMail.SMTPMail")
'Out going SMTP mail server address
objJMail.ServerAddress = strSMTPServer
'Who the e-mail is from
objJMail.Sender = strEmailAddress
'Who the e-mail is sent to
objJMail.AddRecipient strEmailAddress
'The subject of the e-mail
objJMail.Subject = strSubject
'The main body of the e-amil
objJMail.Body = strEmailBody
'Importance of the e-mail
objJMail.Priority = 3
'Send the e-mail
If NOT strSMTPServer = "" Then objJMail.Execute
'Close the server mail object
Set objJMail = Nothing
End Select
'Set the returned value of the function to true
SendMail = True
End Function
%>
[/l]