there are a few parameters missing and you seem to be sending HTMLMail in the TextBody.
This is the function I use for sending HTML mail with CDOSYS
Code:
function CDOSYSHTMLMail(strMailFrom,strMailTo,strMailSubject,strMailMessage)
dim iConf
dim Flds
dim objNewMail
Set iConf = Server.CreateObject ("CDO.Configuration")
Set Flds = iConf.Fields
Flds("http://schemas.microsoft.com/cdo/configuration/sendusing") = cdoSendUsingPort
Flds("http://schemas.microsoft.com/cdo/configuration/smtpserver") = strMailServer
Flds("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = cdoBasic
Flds("http://schemas.microsoft.com/cdo/configuration/sendusername") = strSMTPUser
Flds("http://schemas.microsoft.com/cdo/configuration/sendpassword") = strSMTPPassword
Flds.Update
Set objNewMail = Server.CreateObject("CDO.Message")
Set objNewMail.Configuration = iConf
Err.Clear
objNewMail.To = strMailTo
objNewMail.From = strMailFrom
objNewMail.Subject = strMailSubject
objNewMail.HTMLBody = strMailMessage
On Error Resume Next
objNewMail.Send
If Err <> 0 Then
' add in some error messages.
CDOSYSMail = Err
else
CDOSYSMail = -1
end if
set Flds = nothing
set iConf = nothing
Set objNewMail = nothing
end function
the cdoConstants Programming Articles - Code - ASP - Vbscript Constants - CDO Constants are here
strMailServer, strSMTPUser, strSMTPPassword should be initialised to suit your mail server.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
|