Sub SendMailCDONTS(aTo, Subject, TextBody, aFrom)
Const CdoBodyFormatText = 1
Const CdoBodyFormatHTML = 0
Const CdoMailFormatMime = 0
Const CdoMailFormatText = 1
Dim Message 'As New cdonts.NewMail
'Create CDO message object
Set Message = CreateObject("cdonts.NewMail")
With Message
'Set email adress, subject And body
.To = aTo
.Subject = Subject
.Body = TextBody
'set mail And body format
.MailFormat = CdoMailFormatText
.BodyFormat = CdoBodyFormatText
'Set sender address If specified.
If Len(aFrom) > 0 Then .From = aFrom
'Send the message
.Send
End With
End Sub
***********************************************************************************************************************
Sending email using CDOSYS
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="
mymail@mydomain.com"
myMail.To="
someone@somedomain.com"
myMail.TextBody="This is a message."
myMail.Send
set myMail=nothing
%>