How do I configure Windows 2003 to get VBScript email with CDOSYS.

D

Drummer_Geek

I am trying to use CDO in VBScript to send email from one server to a
separate exchange server. The article at
http://support.microsoft.com/kb/171440/ states that CDOSYS version 6 library
is obtained "through installation" of Windows 2003 but alas, email does not
work and I am unable to locate the CDOSYS.dll on my Windows 2003 system.

I have tried configuring SMTP with Control Panel -> Add or Remove Programs
-> Add/Remove Windows Components -> Application Server -> Internet
Information Services (IIS) -> SMTP Service) but that didn't give me the
CDOSYS.dll or CDO functionality either.

What "installation" feature do I need to install/configure, to get this
functionality?

--
It''s my flaws that keep me humble
 

My Computer

O

OldDog

Re: How do I configure Windows 2003 to get VBScript email withCDOSYS.

On Mar 4, 7:33 pm, Drummer_Geek <[email protected]> wrote:

> I am trying to use CDO in VBScript to send email from one server to a
> separate exchange server.  The article athttp://support.microsoft.com/kb/171440/states that CDOSYS version 6 library
> is obtained "through installation" of Windows 2003 but alas, email does not
> work and I am unable to locate the CDOSYS.dll on my Windows 2003 system.
>
> I have tried configuring SMTP with Control Panel -> Add or Remove Programs
> -> Add/Remove Windows Components -> Application Server -> Internet
> Information Services (IIS) ->  SMTP Service) but that didn't give me the
> CDOSYS.dll or CDO functionality either.
>
> What "installation" feature do I need to install/configure, to get this
> functionality?
>
> --
> It''s my flaws that keep me humble

Here is how I do it:

'<------------Begin----------------------------------------------->

adminmail = "[email protected]"
'
smtp = "mail_server name or IP"
Set mailing = CreateObject("CDO.Message")
Set wshNet = CreateObject("WScript.Network")

mailing.From = ("[email protected]")
mailing.To = adminmail
mailing.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/
configuration/sendusing") = 2
mailing.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/
configuration/smtpserver") = smtp
mailing.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/
configuration/smtpserverport") = 25
mailing.Subject = header & "Data Transfer Success logs"
sFullProductionMessage = "See attached file..." & vbcrlf
mailing.TextBody = sFullProductionMessage
mailing.Configuration.Fields.Update
mailing.AddAttachment "R:\dailylog.txt"
mailing.Send
On Error Goto 0

'<---------------------------- END -----------------------------------

What if you wanted the Attachment to be the body text?

Dim fso, f
Set fso = CreateObject("Scripting.FileSystemObject")
'Open the file for reading
Set f = fso.OpenTextFile("C:\SendLogs\dailylog.txt", ForReading)
'The ReadAll method reads the entire file into the variable BodyText
BodyText = f.ReadAll
'Close the file
f.Close
Set f = Nothing
Set fso = Nothing

And in your message function or sub or whatever;

mailing.TextBody = BodyText

How about CC?

mailing.Cc = "[email protected]"
 

My Computer

D

Drummer_Geek

Re: How do I configure Windows 2003 to get VBScript email with CDO

Thanks but I already have the VBScript code (similiar to yours, minus the
wshnet object, sure you need that?), it just doesn't work. I am unable to
locate CDOSYS on the system. Something is not configured.

--
It''s my flaws that keep me humble


"OldDog" wrote:

> On Mar 4, 7:33 pm, Drummer_Geek <[email protected]> wrote:

> > I am trying to use CDO in VBScript to send email from one server to a
> > separate exchange server. The article athttp://support.microsoft.com/kb/171440/states that CDOSYS version 6 library
> > is obtained "through installation" of Windows 2003 but alas, email does not
> > work and I am unable to locate the CDOSYS.dll on my Windows 2003 system.
> >
> > I have tried configuring SMTP with Control Panel -> Add or Remove Programs
> > -> Add/Remove Windows Components -> Application Server -> Internet
> > Information Services (IIS) -> SMTP Service) but that didn't give me the
> > CDOSYS.dll or CDO functionality either.
> >
> > What "installation" feature do I need to install/configure, to get this
> > functionality?
> >
> > --
> > It''s my flaws that keep me humble
>
> Here is how I do it:
>
> '<------------Begin----------------------------------------------->
>
> adminmail = "[email protected]"
> '
> smtp = "mail_server name or IP"
> Set mailing = CreateObject("CDO.Message")
> Set wshNet = CreateObject("WScript.Network")
>
> mailing.From = ("[email protected]")
> mailing.To = adminmail
> mailing.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/
> configuration/sendusing") = 2
> mailing.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/
> configuration/smtpserver") = smtp
> mailing.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/
> configuration/smtpserverport") = 25
> mailing.Subject = header & "Data Transfer Success logs"
> sFullProductionMessage = "See attached file..." & vbcrlf
> mailing.TextBody = sFullProductionMessage
> mailing.Configuration.Fields.Update
> mailing.AddAttachment "R:\dailylog.txt"
> mailing.Send
> On Error Goto 0
>
> '<---------------------------- END -----------------------------------
>
> What if you wanted the Attachment to be the body text?
>
> Dim fso, f
> Set fso = CreateObject("Scripting.FileSystemObject")
> 'Open the file for reading
> Set f = fso.OpenTextFile("C:\SendLogs\dailylog.txt", ForReading)
> 'The ReadAll method reads the entire file into the variable BodyText
> BodyText = f.ReadAll
> 'Close the file
> f.Close
> Set f = Nothing
> Set fso = Nothing
>
> And in your message function or sub or whatever;
>
> mailing.TextBody = BodyText
>
> How about CC?
>
> mailing.Cc = "[email protected]"
> .
>
 

My Computer

P

Pegasus [MVP]

Re: How do I configure Windows 2003 to get VBScript email with CDO

Did you try copying cdosys.dll from some other system (e.g. WinXP) and
registering it?

"Drummer_Geek" <[email protected]> wrote in message
news:[email protected]

> Thanks but I already have the VBScript code (similiar to yours, minus the
> wshnet object, sure you need that?), it just doesn't work. I am unable to
> locate CDOSYS on the system. Something is not configured.
>
> --
> It''s my flaws that keep me humble
>
>
> "OldDog" wrote:
>

>> On Mar 4, 7:33 pm, Drummer_Geek <[email protected]> wrote:

>> > I am trying to use CDO in VBScript to send email from one server to a
>> > separate exchange server. The article
>> > athttp://support.microsoft.com/kb/171440/states that CDOSYS version 6
>> > library
>> > is obtained "through installation" of Windows 2003 but alas, email does
>> > not
>> > work and I am unable to locate the CDOSYS.dll on my Windows 2003
>> > system.
>> >
>> > I have tried configuring SMTP with Control Panel -> Add or Remove
>> > Programs
>> > -> Add/Remove Windows Components -> Application Server -> Internet
>> > Information Services (IIS) -> SMTP Service) but that didn't give me
>> > the
>> > CDOSYS.dll or CDO functionality either.
>> >
>> > What "installation" feature do I need to install/configure, to get this
>> > functionality?
>> >
>> > --
>> > It''s my flaws that keep me humble
>>
>> Here is how I do it:
>>
>> '<------------Begin----------------------------------------------->
>>
>> adminmail = "[email protected]"
>> '
>> smtp = "mail_server name or IP"
>> Set mailing = CreateObject("CDO.Message")
>> Set wshNet = CreateObject("WScript.Network")
>>
>> mailing.From = ("[email protected]")
>> mailing.To = adminmail
>> mailing.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/
>> configuration/sendusing") = 2
>> mailing.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/
>> configuration/smtpserver") = smtp
>> mailing.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/
>> configuration/smtpserverport") = 25
>> mailing.Subject = header & "Data Transfer Success logs"
>> sFullProductionMessage = "See attached file..." & vbcrlf
>> mailing.TextBody = sFullProductionMessage
>> mailing.Configuration.Fields.Update
>> mailing.AddAttachment "R:\dailylog.txt"
>> mailing.Send
>> On Error Goto 0
>>
>> '<---------------------------- END -----------------------------------
>>
>> What if you wanted the Attachment to be the body text?
>>
>> Dim fso, f
>> Set fso = CreateObject("Scripting.FileSystemObject")
>> 'Open the file for reading
>> Set f = fso.OpenTextFile("C:\SendLogs\dailylog.txt", ForReading)
>> 'The ReadAll method reads the entire file into the variable BodyText
>> BodyText = f.ReadAll
>> 'Close the file
>> f.Close
>> Set f = Nothing
>> Set fso = Nothing
>>
>> And in your message function or sub or whatever;
>>
>> mailing.TextBody = BodyText
>>
>> How about CC?
>>
>> mailing.Cc = "[email protected]"
>> .
>>
 

My Computer

D

Drummer_Geek

Re: How do I configure Windows 2003 to get VBScript email with CDO

YES. We copied and uncomplressed it from the i386 installation folder for
Windows 2003, so it's the right version. We put it in \system32 and tried to
regsrvr it but it refuses to register. I discovered the following
dependencies list (at newsvoter.com) and have confirmed that all these are
present:
msvcrt.dll, oleaut32.dll, version.dll, wininet.dll, urlmon.dll,
inetcomm.dll, kernel32.dll, advapi.dll, user32.dll on the server. It doesn't
seem like it should be this hard.

--

"Pegasus [MVP]" wrote:

> Did you try copying cdosys.dll from some other system (e.g. WinXP) and
> registering it?
>
> "Drummer_Geek" <[email protected]> wrote in message
> news:[email protected]

> > Thanks but I already have the VBScript code (similiar to yours, minus the
> > wshnet object, sure you need that?), it just doesn't work. I am unable to
> > locate CDOSYS on the system. Something is not configured.
> >
> > --
> > It''s my flaws that keep me humble
> >
> >
> > "OldDog" wrote:
> >

> >> On Mar 4, 7:33 pm, Drummer_Geek <[email protected]> wrote:
> >> > I am trying to use CDO in VBScript to send email from one server to a
> >> > separate exchange server. The article
> >> > athttp://support.microsoft.com/kb/171440/states that CDOSYS version 6
> >> > library
> >> > is obtained "through installation" of Windows 2003 but alas, email does
> >> > not
> >> > work and I am unable to locate the CDOSYS.dll on my Windows 2003
> >> > system.
> >> >
> >> > I have tried configuring SMTP with Control Panel -> Add or Remove
> >> > Programs
> >> > -> Add/Remove Windows Components -> Application Server -> Internet
> >> > Information Services (IIS) -> SMTP Service) but that didn't give me
> >> > the
> >> > CDOSYS.dll or CDO functionality either.
> >> >
> >> > What "installation" feature do I need to install/configure, to get this
> >> > functionality?
> >> >
> >> > --
> >> > It''s my flaws that keep me humble
> >>
> >> Here is how I do it:
> >>
> >> '<------------Begin----------------------------------------------->
> >>
> >> adminmail = "[email protected]"
> >> '
> >> smtp = "mail_server name or IP"
> >> Set mailing = CreateObject("CDO.Message")
> >> Set wshNet = CreateObject("WScript.Network")
> >>
> >> mailing.From = ("[email protected]")
> >> mailing.To = adminmail
> >> mailing.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/
> >> configuration/sendusing") = 2
> >> mailing.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/
> >> configuration/smtpserver") = smtp
> >> mailing.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/
> >> configuration/smtpserverport") = 25
> >> mailing.Subject = header & "Data Transfer Success logs"
> >> sFullProductionMessage = "See attached file..." & vbcrlf
> >> mailing.TextBody = sFullProductionMessage
> >> mailing.Configuration.Fields.Update
> >> mailing.AddAttachment "R:\dailylog.txt"
> >> mailing.Send
> >> On Error Goto 0
> >>
> >> '<---------------------------- END -----------------------------------
> >> >
> >>
> >> What if you wanted the Attachment to be the body text?
> >>
> >> Dim fso, f
> >> Set fso = CreateObject("Scripting.FileSystemObject")
> >> 'Open the file for reading
> >> Set f = fso.OpenTextFile("C:\SendLogs\dailylog.txt", ForReading)
> >> 'The ReadAll method reads the entire file into the variable BodyText
> >> BodyText = f.ReadAll
> >> 'Close the file
> >> f.Close
> >> Set f = Nothing
> >> Set fso = Nothing
> >>
> >> And in your message function or sub or whatever;
> >>
> >> mailing.TextBody = BodyText
> >>
> >> How about CC?
> >>
> >> mailing.Cc = "[email protected]"
> >> .
> >>
> .
>
 

My Computer

Top