RE: Using VBScript to send message using CDO.message
- From: JMS <JMS@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Apr 2005 10:06:06 -0700
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@xxxxxx"
.To = "to@xxxxxx"
.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@xxxxxxxxxxxxx"
> objEmail.To = "jms@xxxxxxxxxxxxx"
> objEmail.Subject = "Something didn't work!"
> objEmail.Textbody = "The import at " & now & " failed."
> objEmail.Send
>
> Set objEmail = Nothing
>
.
- Follow-Ups:
- References:
- Prev by Date: Re: Help ! Wrong Number of properties or invalid property assignment !
- Next by Date: Searching excel or txt file for duplicate entries
- Previous by thread: RE: Using VBScript to send message using CDO.message
- Next by thread: RE: Using VBScript to send message using CDO.message
- Index(es):
Relevant Pages
|
Loading