Use MailIt to send an email with the jmail.smtpmail object.
<%
Const UseJmail = "jmail.smtpmail"
Dim boolSent
boolSent = MailIt(UseJmail, "to@to.com", _
"from@from.com", "mail subject line", "mail body text")
If boolSent Then
Response.Write "Mail Sent Successfully!"
Else
Response.Write "Mail Not Sent!"
End If
%>
Use MailIt to send an email with the CDONTS.NewMail object.
<%
Const UseCDO = "cdonts.newmail"
Dim boolSent
boolSent = MailIt(UseCDO, "to@to.com", _
"from@from.com", "mail subject line", "mail body text")
If boolSent Then
Response.Write "Mail Sent Successfully!"
Else
Response.Write "Mail Not Sent!"
End If
%>
<%
Private Function MailIt(byVal classstring, byVal mailto, _
byVal mailfrom, byVal mailsubject, byVal mailbody)
Dim Mailer, objCDO
Select Case LCase(classstring)
Case "jmail.smtpmail"
On Error Resume Next
Set Mailer = Server.CreateObject("jmail.smtpmail")
With Mailer
.ServerAddress = "entermailserveraddresshere"
.Sender = mailfrom
.AddRecipient mailto
.Subject = mailsubject
.Body = mailbody
.Execute
End With
If Err Then
MailIt = False
Else
MailIt = True
End If
Set Mailer = Nothing
On Error GoTo 0
Case "cdonts.newmail"
On Error Resume Next
Set objCDO = Server.CreateObject("CDONTS.NewMail")
With objCDO
.Subject = mailsubject
.To = mailto
.From = mailfrom
.Body = mailbody
.Send
End With
If Err Then
MailIt = False
Else
MailIt = True
End If
Set objCDO = Nothing
On Error GoTo 0
Case Else
MailIt = False
Err.Raise 5030, "MailIt Function", _
"Unknown class string argument. " & _
"The MailIt function does " & _
"not support this mail object."
End Select
End Function
%>