470,619 Members | 2,033 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,619 developers. It's quick & easy.

specify user+pwd in CDO/CDONTS

Hello

I have a mailserver that requires windows authentication for sending email.

could you guys show me an example of how to specify user and password in
CDO/CDONTS?

i cant configure it to send with no authentication.

TIA
/Lasse
Jul 19 '05 #1
11 3926
I don't think CDO.Message supports that. The commercial version of ASPEmail
does (http://www.aspemail.com/)

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Lasse Edsvik" <la***@nospam.com> wrote in message
news:#3**************@TK2MSFTNGP10.phx.gbl...
Hello

I have a mailserver that requires windows authentication for sending email.
could you guys show me an example of how to specify user and password in
CDO/CDONTS?

i cant configure it to send with no authentication.

TIA
/Lasse

Jul 19 '05 #2
"Lasse Edsvik" <la***@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hello

I have a mailserver that requires windows authentication for sending email.
could you guys show me an example of how to specify user and password in
CDO/CDONTS?

i cant configure it to send with no authentication. Something like below should work.

Note that CDO is the -backbone- component for Outlook express and for
Exchange (serverside). So, if any mail feature that Outlook Express
supports, can be programmed by you.

code below is non-tested but should be working.

Set myCDO = CreateObject("CDO.Configuration")
with cdoConfig.fields
.item("http://schemas.microsoft.com/cdo/configuration/sendusing").value =
2

..item("http://schemas.microsoft.com/cdo/configuration/smtpserver").value =
"192.168.0.7"

..item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate").val
ue = 1 ' use clear text authenticate

..item("http://schemas.microsoft.com/cdo/configuration/sendpassword").value =
"mypassword"

..item("http://schemas.microsoft.com/cdo/configuration/sendusername").value =
"yourusername"
.update
End With
--
compatible web farm Session replacement for Asp and Asp.Net
http://www.nieropwebconsult.nl/asp_session_manager.htm

TIA
/Lasse


Jul 19 '05 #3
"Aaron Bertrand - MVP" <aa***@TRASHaspfaq.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
I don't think CDO.Message supports that.
The commercial version of ASPEmail > does (http://www.aspemail.com/)
CDO does as well :)

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


Jul 19 '05 #4
Wow, I stand corrected, thanks Egbert! Now off to update all the FAQ
articles that state CDO is incapable of outgoing auth...

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Egbert Nierop (MVP for IIS)" <eg***********@nospam.com> wrote in message
news:OG**************@tk2msftngp13.phx.gbl...
"Lasse Edsvik" <la***@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hello

I have a mailserver that requires windows authentication for sending email.

could you guys show me an example of how to specify user and password in
CDO/CDONTS?

i cant configure it to send with no authentication.

Something like below should work.

Note that CDO is the -backbone- component for Outlook express and for
Exchange (serverside). So, if any mail feature that Outlook Express
supports, can be programmed by you.

code below is non-tested but should be working.

Set myCDO = CreateObject("CDO.Configuration")
with cdoConfig.fields
.item("http://schemas.microsoft.com/cdo/configuration/sendusing").value

= 2

.item("http://schemas.microsoft.com/cdo/configuration/smtpserver").value =
"192.168.0.7"

..item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate").val ue = 1 ' use clear text authenticate

.item("http://schemas.microsoft.com/cdo/configuration/sendpassword").value = "mypassword"

.item("http://schemas.microsoft.com/cdo/configuration/sendusername").value = "yourusername"
.update
End With
--
compatible web farm Session replacement for Asp and Asp.Net
http://www.nieropwebconsult.nl/asp_session_manager.htm

TIA
/Lasse

Jul 19 '05 #5
"Aaron Bertrand [MVP]" <aa***@TRASHaspfaq.com> wrote in message
news:eP**************@TK2MSFTNGP10.phx.gbl...
Wow, I stand corrected, thanks Egbert! Now off to update all the FAQ
articles that state CDO is incapable of outgoing auth...


CDO rocks!
But if you state that in the FAQ, if you have time, check the code :) I
might have forgotten something.
Jul 19 '05 #6
> But if you state that in the FAQ, if you have time, check the code :) I
might have forgotten something.


Tested, updated.
http://www.aspfaq.com/2026#auth

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #7

"Aaron Bertrand [MVP]" <aa***@TRASHaspfaq.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
But if you state that in the FAQ, if you have time, check the code :) I
might have forgotten something.

Looks good.
Thanks for the good work :)
Jul 19 '05 #8
Thanks aron and egbert..... works....

btw....... why is this needed?

<!--
METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library"
-->

hard to remember that til next time its needed :(

/Lasse
"Lasse Edsvik" <la***@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hello

I have a mailserver that requires windows authentication for sending email.
could you guys show me an example of how to specify user and password in
CDO/CDONTS?

i cant configure it to send with no authentication.

TIA
/Lasse

Jul 19 '05 #9
This is a Type Library that allows you to use named constants. Beats
remembering the number and/or hex values for all the parameters...

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Lasse Edsvik" <la***@nospam.com> wrote in message
news:Oq*************@tk2msftngp13.phx.gbl...
Thanks aron and egbert..... works....

btw....... why is this needed?

<!--
METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library"
-->

hard to remember that til next time its needed :(

/Lasse
"Lasse Edsvik" <la***@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hello

I have a mailserver that requires windows authentication for sending

email.

could you guys show me an example of how to specify user and password in
CDO/CDONTS?

i cant configure it to send with no authentication.

TIA
/Lasse


Jul 19 '05 #10
Aaron,

but its possible do it without it?

/Lasse

"Aaron Bertrand [MVP]" <aa***@TRASHaspfaq.com> wrote in message
news:ut**************@tk2msftngp13.phx.gbl...
This is a Type Library that allows you to use named constants. Beats
remembering the number and/or hex values for all the parameters...

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"Lasse Edsvik" <la***@nospam.com> wrote in message
news:Oq*************@tk2msftngp13.phx.gbl...
Thanks aron and egbert..... works....

btw....... why is this needed?

<!--
METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library"
-->

hard to remember that til next time its needed :(

/Lasse
"Lasse Edsvik" <la***@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
Hello

I have a mailserver that requires windows authentication for sending

email.

could you guys show me an example of how to specify user and password in CDO/CDONTS?

i cant configure it to send with no authentication.

TIA
/Lasse



Jul 19 '05 #11
> but its possible do it without it?

Sure, if you want a bunch of statements like this:

CONST cdoBlahBlah = 1
CONST cdoSomethingElse = 5
CONST cdoAnotherThing = 0xH0004
....

Or, if you want to memorize the value for each and know without question
what it means (note that this makes your code much more cryptic).

Or, if you want to use the more verbose, and slightly misleading, URL style,
e.g.

Set cdoConfig = CreateObject("CDO.Configuration")

cdoConfig.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendus
ing") = 2

(But you still have to remember what 2 means! Does that mean local pickup,
or use a specific smtp server?)

You seem to be troubled by the fact that you might have to memorize that
metadata tag? Not sure why you might think that; I certainly don't have it
memorized. You can put that metadata tag in a text file, somewhere easy to
reach, and just copy and paste. Or you can just grab it from
http://www.aspfaq.com/2026 whenever you need it.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/
Jul 19 '05 #12

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by greatcanyon | last post: by
7 posts views Thread by gopal | last post: by
7 posts views Thread by Paul | last post: by
15 posts views Thread by Earl Partridge | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.