Ok, I don't get this. I used the stock script from the Script Center
repository for sending a message on my PC and it works. I use it on a
Windows 2003 server and it won't. I'm getting this message:

CDO.Message.1: The "SendUsing" configuration value is invalid.

What's this mean? I thought it was because Outlook wasn't installed on the
server. Well, a full-blown install is now there and I STILL get this problem.

The code is just this easy and nothing but the Script Center website sample:

Dim objEmail

Set objEmail = CreateObject("CDO.Message")
objEmail.From = "server@mycompany.com"
objEmail.To = "jms@mycompany.com"
objEmail.Subject = "Something didn't work!"
objEmail.Textbody = "The import at " & now & " failed."
objEmail.Send

Set objEmail = Nothing

Re: Using VBScript to send message using CDO.message by Torgeir

Torgeir
Thu Apr 28 09:13:37 CDT 2005

JMS wrote:

> Ok, I don't get this. I used the stock script from the Script Center
> repository for sending a message on my PC and it works. I use it on a
> Windows 2003 server and it won't. I'm getting this message:
>
> CDO.Message.1: The "SendUsing" configuration value is invalid.
>
> What's this mean? I thought it was because Outlook wasn't installed on the
> server. Well, a full-blown install is now there and I STILL get this problem.
>
> The code is just this easy and nothing but the Script Center website sample:
>
> Dim objEmail
>
> Set objEmail = CreateObject("CDO.Message")
> objEmail.From = "server@mycompany.com"
> objEmail.To = "jms@mycompany.com"
> objEmail.Subject = "Something didn't work!"
> objEmail.Textbody = "The import at " & now & " failed."
> objEmail.Send
>
> Set objEmail = Nothing
Hi,

I would think you need to fill in the smtp server name in your code,
more about this in the following newsgroup thread:

http://groups.google.co.uk/groups?threadm=b3aca%2440e45141%24c09cfd6%2425677%40msgid.meganewsservers.com


--
torgeir, Microsoft MVP Scripting and WMI, Porsgrunn Norway
Administration scripting examples and an ONLINE version of
the 1328 page Scripting Guide:
http://www.microsoft.com/technet/scriptcenter/default.mspx

RE: Using VBScript to send message using CDO.message by Vladimir

Vladimir
Thu Apr 28 09:26:10 CDT 2005

Use CDO.Configuration object:

Set objConf = CreateObject("CDO.Configuration")
Set Flds = objConf.Fields

With Flds
' assume constants are defined within script file
.Item(cdoSendUsingMethod) = 2 ' cdoSendUsingPort
.Item(cdoSMTPServerName) = "somehost@microsoftc.om"
.Item(cdoSMTPConnectionTimeout) = 10 ' quick timeout
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "username"
.Item(cdoSendPassword) = "password"
.Item(cdoURLProxyServer) = "server:80"
.Item(cdoURLProxyBypass) = "<local>"
.Item(cdoURLGetLatestVersion) = True
.Update
End With

Set objEmail = CreateObject("CDO.Message")

Set objEmail.Configuration = objConf
...

RE: Using VBScript to send message using CDO.message by JMS

JMS
Thu Apr 28 12:06:06 CDT 2005

Ok, so now what? I found this code snippet, which is similar to Vlad's idea,
and now I get this error:

ADODB.Fields: Arguments are of the wrong type, are out of acceptable range,
or are in conflict with one another.

Note I've tried subbing 2 for cdoSendUsingPort as Vlad suggests, but no go.

This is not working from my XP machine. I haven't even tried it on my
server yet.

Set cdoConfig = CreateObject("CDO.Configuration")

With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "server.mycompany.com"
.Update
End With

Set cdoMessage = CreateObject("CDO.Message")

With cdoMessage
Set .Configuration = cdoConfig
.From = "from@me.com"
.To = "to@me.com"
.Subject = "Sample CDO Message"
.TextBody = "This is a test for CDO.message"
.Send
End With

Set cdoMessage = Nothing
Set cdoConfig = Nothing




"JMS" wrote:

> Ok, I don't get this. I used the stock script from the Script Center
> repository for sending a message on my PC and it works. I use it on a
> Windows 2003 server and it won't. I'm getting this message:
>
> CDO.Message.1: The "SendUsing" configuration value is invalid.
>
> What's this mean? I thought it was because Outlook wasn't installed on the
> server. Well, a full-blown install is now there and I STILL get this problem.
>
> The code is just this easy and nothing but the Script Center website sample:
>
> Dim objEmail
>
> Set objEmail = CreateObject("CDO.Message")
> objEmail.From = "server@mycompany.com"
> objEmail.To = "jms@mycompany.com"
> objEmail.Subject = "Something didn't work!"
> objEmail.Textbody = "The import at " & now & " failed."
> objEmail.Send
>
> Set objEmail = Nothing
>

RE: Using VBScript to send message using CDO.message by JMS

JMS
Fri Apr 29 09:34:04 CDT 2005

Turns out that SMTP was not installed on the server and this was the cause.
Friggin' IIS 6 bit me!

"JMS" wrote:

> Ok, so now what? I found this code snippet, which is similar to Vlad's idea,
> and now I get this error:
>
> ADODB.Fields: Arguments are of the wrong type, are out of acceptable range,
> or are in conflict with one another.
>
> Note I've tried subbing 2 for cdoSendUsingPort as Vlad suggests, but no go.
>
> This is not working from my XP machine. I haven't even tried it on my
> server yet.
>
> Set cdoConfig = CreateObject("CDO.Configuration")
>
> With cdoConfig.Fields
> .Item(cdoSendUsingMethod) = cdoSendUsingPort
> .Item(cdoSMTPServer) = "server.mycompany.com"
> .Update
> End With
>
> Set cdoMessage = CreateObject("CDO.Message")
>
> With cdoMessage
> Set .Configuration = cdoConfig
> .From = "from@me.com"
> .To = "to@me.com"
> .Subject = "Sample CDO Message"
> .TextBody = "This is a test for CDO.message"
> .Send
> End With
>
> Set cdoMessage = Nothing
> Set cdoConfig = Nothing
>
>
>
>
> "JMS" wrote:
>
> > Ok, I don't get this. I used the stock script from the Script Center
> > repository for sending a message on my PC and it works. I use it on a
> > Windows 2003 server and it won't. I'm getting this message:
> >
> > CDO.Message.1: The "SendUsing" configuration value is invalid.
> >
> > What's this mean? I thought it was because Outlook wasn't installed on the
> > server. Well, a full-blown install is now there and I STILL get this problem.
> >
> > The code is just this easy and nothing but the Script Center website sample:
> >
> > Dim objEmail
> >
> > Set objEmail = CreateObject("CDO.Message")
> > objEmail.From = "server@mycompany.com"
> > objEmail.To = "jms@mycompany.com"
> > objEmail.Subject = "Something didn't work!"
> > objEmail.Textbody = "The import at " & now & " failed."
> > objEmail.Send
> >
> > Set objEmail = Nothing
> >