Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_cdo thread: Looking for good documentation - CDO for Windows 2000


Message #1 by "Diane Schips" <info@M...> on Mon, 13 May 2002 13:31:23 -0400
I have the book ASP 3.0 Programmer's Reference by Wrox, and I've looked at
the MS documentation.  I'm still having problems.  Is there any
documentation around - preferably on the web - that makes all this any
clearer?

Diane

Message #2 by "Siegfried Weber" <sweber@c...> on Wed, 15 May 2002 02:19:58 +0200
A lot of resources do exist. I just did a quick search on Google about
CDOSYS and found 822 hits.

But instead of struggling finding a resource, why not tell us here what
your problem is? Maybe somebody can help.

<Siegfried />

> -----Original Message-----
> From: Diane Schips [mailto:info@M...]
> Sent: Monday, May 13, 2002 7:31 PM
> To: ASP CDO
> Subject: [asp_cdo] Looking for good documentation - CDO for Windows
2000
>
> I have the book ASP 3.0 Programmer's Reference by Wrox, and I've
looked at
> the MS documentation.  I'm still having problems.  Is there any
> documentation around - preferably on the web - that makes all this any
> clearer?
>
> Diane
>
>
Message #3 by "Diane Schips" <info@M...> on Wed, 15 May 2002 00:32:31 -0400
True, but most of what I'm finding uses the same wording and examples as
Microsoft.  Reading the same stuff in different places doesn't make that
stuff any more comprehensible.

I don't want to start asking a thousand novice questions.  I'd rather learn
as much as I can, then start asking at least somewhat intelligent questions
when i run into a problem.  At the moment, I'm trying to get a good overview
of how it works.  But if you all don't mind lots of questions, I'll start
asking them.

Diane


-----Original Message-----
From: Siegfried Weber [mailto:sweber@c...]
Sent: Tuesday, May 14, 2002 8:20 PM
To: ASP CDO
Subject: [asp_cdo] RE: Looking for good documentation - CDO for Windows
2000


A lot of resources do exist. I just did a quick search on Google about
CDOSYS and found 822 hits.

But instead of struggling finding a resource, why not tell us here what
your problem is? Maybe somebody can help.

<Siegfried />

> -----Original Message-----
> From: Diane Schips [mailto:info@M...]
> Sent: Monday, May 13, 2002 7:31 PM
> To: ASP CDO
> Subject: [asp_cdo] Looking for good documentation - CDO for Windows
2000
>
> I have the book ASP 3.0 Programmer's Reference by Wrox, and I've
looked at
> the MS documentation.  I'm still having problems.  Is there any
> documentation around - preferably on the web - that makes all this any
> clearer?
>
> Diane
>
>


Message #4 by "Siegfried Weber" <sweber@c...> on Wed, 15 May 2002 13:37:26 +0200
True about the same wording and examples (sadly enough). So...

What is CDOSYS (aka CDO for Windows 2000)?
It is a COM (Microsoft Component Object Model) component which can be
used to send SMTP e-mail or post NNTP messages. It works only on top of
Windows 2000 or Windows XP/.NET Server. As with all COM components you
can use it with ASP by doing a CreateObject().

How does it work?
You can either use it to submit messages via any remote SMTP mail server
& port of your choice (if the server does allow you to submit your
messages of course) or use the locally Windows 2000/.NET Server SMTP
Service to "drop" the message into a directory (called "Pickup") for
delivery.
Also you can it to submit NNTP posts to a newsserver of your choice
(again either via server & port) or "drop" it to the local Windows
2000/.NET Server NNTP service's NNTP newsgroups.

Now go ahead and ask questions ;-) At least I don't mind at all and
since this list has an archive it might be beneficial for future members
also.

<Siegfried />

> -----Original Message-----
> From: Diane Schips [mailto:info@M...]
> Sent: Wednesday, May 15, 2002 6:33 AM
> To: ASP CDO
> Subject: [asp_cdo] RE: Looking for good documentation - CDO for
Windows
> 2000
>
> True, but most of what I'm finding uses the same wording and examples
as
> Microsoft.  Reading the same stuff in different places doesn't make
that
> stuff any more comprehensible.
>
> I don't want to start asking a thousand novice questions.  I'd rather
> learn
> as much as I can, then start asking at least somewhat intelligent
> questions
> when i run into a problem.  At the moment, I'm trying to get a good
> overview
> of how it works.  But if you all don't mind lots of questions, I'll
start
> asking them.
>
> Diane
>
>
> -----Original Message-----
> From: Siegfried Weber [mailto:sweber@c...]
> Sent: Tuesday, May 14, 2002 8:20 PM
> To: ASP CDO
> Subject: [asp_cdo] RE: Looking for good documentation - CDO for
Windows
> 2000
>
>
> A lot of resources do exist. I just did a quick search on Google about
> CDOSYS and found 822 hits.
>
> But instead of struggling finding a resource, why not tell us here
what
> your problem is? Maybe somebody can help.
>
> <Siegfried />
>
> > -----Original Message-----
> > From: Diane Schips [mailto:info@M...]
> > Sent: Monday, May 13, 2002 7:31 PM
> > To: ASP CDO
> > Subject: [asp_cdo] Looking for good documentation - CDO for Windows
> 2000
> >
> > I have the book ASP 3.0 Programmer's Reference by Wrox, and I've
> looked at
> > the MS documentation.  I'm still having problems.  Is there any
> > documentation around - preferably on the web - that makes all this
any
> > clearer?
> >
> > Diane
> >
> >
>
>
>
Message #5 by "Diane Schips" <info@M...> on Fri, 17 May 2002 16:27:50 -0400
Thanks Siegfried.

I think I'll go through this one piece at a time.  I don't just want to send
a message, I want to understand the component, so that I can user it to the
fullest extent.

To start, I'm confused about the BodyParts.  Regarding the BodyPart object
methods, AddBodyPart, SaveToFile, GetFieldParameter and GetInterface are
clear in concept at least, but where does the stream come from in GetStream,
GetDecodedContentStream and GetEncodedContentStream?  For GetFieldParameter,
what fields/parameters can I check, and what do the results mean?

For the BodyParts properties, what does ContentClass and ContentClassName
refer to?  What is in the fields collection, and how would I use the
FileName?

The methods at least are clear!

Diane

-----Original Message-----
From: Siegfried Weber [mailto:sweber@c...]
Sent: Wednesday, May 15, 2002 7:37 AM
To: ASP CDO
Subject: [asp_cdo] RE: Looking for good documentation - CDO for Windows
2000


True about the same wording and examples (sadly enough). So...

What is CDOSYS (aka CDO for Windows 2000)?
It is a COM (Microsoft Component Object Model) component which can be
used to send SMTP e-mail or post NNTP messages. It works only on top of
Windows 2000 or Windows XP/.NET Server. As with all COM components you
can use it with ASP by doing a CreateObject().

How does it work?
You can either use it to submit messages via any remote SMTP mail server
& port of your choice (if the server does allow you to submit your
messages of course) or use the locally Windows 2000/.NET Server SMTP
Service to "drop" the message into a directory (called "Pickup") for
delivery.
Also you can it to submit NNTP posts to a newsserver of your choice
(again either via server & port) or "drop" it to the local Windows
2000/.NET Server NNTP service's NNTP newsgroups.

Now go ahead and ask questions ;-) At least I don't mind at all and
since this list has an archive it might be beneficial for future members
also.

<Siegfried />

> -----Original Message-----
> From: Diane Schips [mailto:info@M...]
> Sent: Wednesday, May 15, 2002 6:33 AM
> To: ASP CDO
> Subject: [asp_cdo] RE: Looking for good documentation - CDO for
Windows
> 2000
>
> True, but most of what I'm finding uses the same wording and examples
as
> Microsoft.  Reading the same stuff in different places doesn't make
that
> stuff any more comprehensible.
>
> I don't want to start asking a thousand novice questions.  I'd rather
> learn
> as much as I can, then start asking at least somewhat intelligent
> questions
> when i run into a problem.  At the moment, I'm trying to get a good
> overview
> of how it works.  But if you all don't mind lots of questions, I'll
start
> asking them.
>
> Diane
>
>
> -----Original Message-----
> From: Siegfried Weber [mailto:sweber@c...]
> Sent: Tuesday, May 14, 2002 8:20 PM
> To: ASP CDO
> Subject: [asp_cdo] RE: Looking for good documentation - CDO for
Windows
> 2000
>
>
> A lot of resources do exist. I just did a quick search on Google about
> CDOSYS and found 822 hits.
>
> But instead of struggling finding a resource, why not tell us here
what
> your problem is? Maybe somebody can help.
>
> <Siegfried />
>
> > -----Original Message-----
> > From: Diane Schips [mailto:info@M...]
> > Sent: Monday, May 13, 2002 7:31 PM
> > To: ASP CDO
> > Subject: [asp_cdo] Looking for good documentation - CDO for Windows
> 2000
> >
> > I have the book ASP 3.0 Programmer's Reference by Wrox, and I've
> looked at
> > the MS documentation.  I'm still having problems.  Is there any
> > documentation around - preferably on the web - that makes all this
any
> > clearer?
> >
> > Diane
> >
> >
>
>
>


Message #6 by "Diane Schips" <info@M...> on Fri, 17 May 2002 16:58:50 -0400
Siegfried,

Do I understand this part of the configuration correctly?
Flds(cdoSendUsingMethod) = cdoSendUsingPickup - messages are queued
Flds(cdoSendUsingMethod) = cdoSendUsingPort - messages are sent one at a
time

The following are used with news messages while the above are for email
messages?
Flds(cdoPostUsingMethod) = cdoPostUsingPickup
Flds(cdoPostUsingMethod) = cdoPostUsingPort

What are my options for cdoSMTPAuthenticate?  Do I want to use cdoAnonumous,
and if so, why?

Again, thanks,
Diane


Message #7 by "Diane Schips" <info@M...> on Fri, 17 May 2002 17:43:36 -0400
Siegfried:

I've been trying to make enough sense out of this to be able to send a
message with both text and HTML parts.  Both are passed to the following
function as strings.  Would this work?  Are the config settings correct
(queued, using cdoBasic)?  What am I missing?  Will this configuration avoid
tripping the spam filters?  What other information can/should I include?

Sub newEmail (emFrom, emTo, emSubject, emText, emHtml)
   Dim objConf As New CDO.Configuration
   Dim objMsg As New CDO.Message
   Dim Flds  As ADODB.Fields
   Set Flds = objConf.Fields

   ' Set the configuration
   With Flds
      .Item(cdoSendUsingMethod)  = cdoSendUsingPickup
      .Item(cdoSMTPServer)       = "mail.TBSofS.org"
      .Item(cdoSMTPAuthenticate) = cdoBasic
      'the following are only needed for cdoBasic
      .Item(cdoSendUserName)     = "webmaster@T..."
      .Item(cdoSendPassword)     = myPassword
      .Update
   End With

   With objMsg
      Set .Configuration = objConf
      .To       = emTo 'in "Display Name" <recipient@m...> format
      .From     = emFrom
      .Subject  = emSubject
      .HTMLBody = emHtml
      if emText <> "" then 'I am supplying the text, which I don't always do
         .AutoGenerateTextBody = false
         .TextBody = emText
      end if
      .send
   End With

   Set objMsg = Nothing
   Set objConf = Nothing
End Sub

Diane

Message #8 by "Siegfried Weber" <sweber@c...> on Thu, 30 May 2002 18:31:31 +0200
Inline (and sorry for the delay but I've been OOF traveling and doing
trainings)...

> -----Original Message-----
> I've been trying to make enough sense out of this to be able to send a
> message with both text and HTML parts.  Both are passed to the
following
> function as strings.  Would this work?

Your code looks perfect to me.

> Are the config settings correct (queued, using cdoBasic)?

There is no setting with CDOSYS to queue mail. See my other reply to
you.

> What am I missing?

Maybe some error checking if the send method didn't fail und such
things.

> Will this configuration avoid tripping the spam filters?

I am not sure what you mean with "tripping" but your code will send the
message using the pickup directory of the locally installed Windows 2000
SMTP service. Using the pickup dir also makes it obsolete to supply
authentication information. Those only work if you submit the message
via a remote SMTP service using a port & FQDN.

> What other information can/should I include?

If you like, you can add delivery receipt requests..

[snip]

<Siegfried />
Message #9 by "Siegfried Weber" <sweber@c...> on Thu, 30 May 2002 18:36:38 +0200
Inline...
> -----Original Message-----
> Do I understand this part of the configuration correctly?
> Flds(cdoSendUsingMethod) =3D cdoSendUsingPickup - messages are queued
> Flds(cdoSendUsingMethod) =3D cdoSendUsingPort - messages are sent one 
at
a
> time

Correct. cdoSendUsing* is for SMTP. But note that cdoSendUsingMethod =3D
cdoSendUsingPickup does not queue messages. It just submits them the
locally installed Windows 2000 SMTP Service and, if the service is
running, are picked up from there immediately to get submitted.

> The following are used with news messages while the above are for
email
> messages?
> Flds(cdoPostUsingMethod) =3D cdoPostUsingPickup
> Flds(cdoPostUsingMethod) =3D cdoPostUsingPort

Correct. cdoPostUsing* is for NNTP.

> What are my options for cdoSMTPAuthenticate?  Do I want to use
> cdoAnonumous, and if so, why?

cdoAnonumous is intended to be used with a remote SMTP service of any
brand if you are not required to authenticate to submit your message.
Most SMTP services are configured to prevent relaying which basically
means that you cannot do something like this:

mail from: bill@m...
rcpt to: steve@m...

If you use the SMTP service which only accepts messages for the SMTP
domain "MainshipSystems.com".

If this SMTP service is configured to allow authenticated users to relay
then the above config will work if you use cdoSMTPAuthenticate and
provide a valid user name & password. But that needs to be configured on
the SMTP Service...

<Siegfried />

Message #10 by "Siegfried Weber" <sweber@c...> on Thu, 30 May 2002 18:41:21 +0200
Inline...

> -----Original Message-----
> To start, I'm confused about the BodyParts.  Regarding the BodyPart
object
> methods, AddBodyPart, SaveToFile, GetFieldParameter and GetInterface
are
> clear in concept at least, but where does the stream come from in
> GetStream,
> GetDecodedContentStream and GetEncodedContentStream?

Using the stream stuff you can, once you have created a message with
CDOSYS, obtain the whole message as it appears in SMTP as single stream.
While I don't use that when submitting messages I have used GetStream
when I was developing Transport Event Sinks which can pick messages out
of the Windows 2000/.NET Server SMTP Service (send an e-mail to
mshelp@c...?subject=3DQ123456 and wait for the returned mail to 
get
a clue what those Transport Events are good for)

> For GetFieldParameter,
> what fields/parameters can I check, and what do the results mean?

I haven't played with those but I believe you can use them to retrieve
single properties of a bodypart like the attachment encoding and such.

> For the BodyParts properties, what does ContentClass and
ContentClassName
> refer to?

Those define what attachment type it could be. Like a WAV or such.

> What is in the fields collection, and how would I use the
> FileName?

Each attachment does have a file name and the fields collection holds
advanced information about the attachment.

<Siegfried />

  Return to Index