Discussion:
CDO.Message Errors
(too old to reply)
ScottLoe
2008-12-02 18:07:01 UTC
Permalink
I have a Windows 2000 SP4 Server with IIS 5.0 and SMTP installed. The SMTP
is set up to relay to my Exchange Server.

The following code worked fine until 2 weeks ago when I did a microsoft
update.

<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From="***@domain.com"
myMail.To="***@domain.com"
myMail.TextBody="This is a message."
myMail.Send
set myMail=nothing
%>
After I did the updates, I've been getting the following error:

Category=CDO.Message.1
Number=(0x80040220)
Description=The "SendUsing" configuration value is invalid.


I searched the internet for solutions and I changed the code to this:

<%
Dim iMsg
Dim iConf
Dim Flds
Const cdoSendUsingPort = 2
Const strSmartHost = "x.x.x.x"
'I tried using the IP of my Exchange Server and IP of the IIS SMTP

Set iMsg = CreateObject("CDO.Message")
Set iConf = iMsg.Configuration
With iConf.Fields
.item("http://schemas.microsoft.com/cdo/configuration/sendusing") =
cdoSendUsingPort
.item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
strSmartHost

.item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With

With iMsg
.To = "***@domain.com"
.From = "***@domain.com"
.Subject = "Test message sent on: " & now()
.TextBody = "This is a test"
.Send
End With
set iMsg = Nothing
set iConf = Nothing
%>

When I ran this script, I did not get the email but I did get this error
message:

Category=
Number=(0x80040211)
Description=


For kicks I ran my old CDONTS script:

<%
Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
objCDOMail.To = "***@domain.com" 'the destination
objCDOMail.From = "***@domain.com" 'the sender
objCDOMail.Subject = "Test CDONTS"
'objCDOMail.TextBody = "test"
objCDOMail.Send 'fire off the email
set objCDOMail=nothing

%>

This worked fine. No errors and I received the test email using this CDONTS
script.

What can I do about the CDO.Message? I do not want to revert back to using
CDONTS.
h***@gmail.com
2008-12-04 04:11:30 UTC
Permalink
I have a Windows 2000 SP4 Server with IIS 5.0 and SMTP installed.  The SMTP
is set up to relay to my Exchange Server.
The following code worked fine until 2 weeks ago when I did a microsoft
update.
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.TextBody="This is a message."
myMail.Send
set myMail=nothing
%>
Category=CDO.Message.1
Number=(0x80040220)
Description=The "SendUsing" configuration value is invalid.
<%
    Dim iMsg
    Dim iConf
    Dim Flds
    Const cdoSendUsingPort = 2
    Const strSmartHost = "x.x.x.x"
'I tried using the IP of my Exchange Server and IP of the IIS SMTP
    Set iMsg = CreateObject("CDO.Message")
    Set iConf = iMsg.Configuration
    With iConf.Fields
       .item("http://schemas.microsoft.com/cdo/configuration/sendusing") =
cdoSendUsingPort
       .item("http://schemas.microsoft.com/cdo/configuration/smtpserver") =
strSmartHost
.item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
       .Update
    End With
    With iMsg
        .Subject = "Test message sent on: "  & now()
        .TextBody = "This is a test"
        .Send
    End With
    set iMsg = Nothing
    set iConf = Nothing
%>
When I ran this script, I did not get the email but I did get this error
Category=
Number=(0x80040211)
Description=
<%
   Set objCDOMail = Server.CreateObject("CDONTS.NewMail")
   objCDOMail.Subject = "Test CDONTS"
   'objCDOMail.TextBody = "test"
   objCDOMail.Send   'fire off the email
   set objCDOMail=nothing
%>
This worked fine.  No errors and I received the test email using this CDONTS
script.
What can I do about the CDO.Message?  I do not want to revert back to using
CDONTS.
If i recall correctly Win2K Server/IIS 5 only works with CDONTS and
not CDOSYS. The CDOSYS was introduced in IIS5.X and later. I do know
you can still use CDONTS on IIS5.X and later by copying and
registering the CDONTS.DLL on the machine, but I am unsure is you can
take the CDOSYS.DLL and register it on the Win2K server machine and
have it work correctly. Has been a while since I have dealt with IIS5.

Larry
www.windowsadminscripts.com

Continue reading on narkive:
Loading...