Thanks Juan...
Yes I am using ASP.NET 2.0
But good old Intellisense came to the rescue right after my rant.
The accepted syntax is:
<smtp deliveryMethod="Network">
Isn't that a hoot? Just capitalize Network in it gets accepted.
But during my research I found out that back in May 2006 there was a bug in
System.Net.Mail
If you were hard coding the credentials and used the syntax...
UseDefaultCredentials = false
The ID and Password you coded would be ignored and not sent to the smtp
server.
The fix was to NOT refer to UseDefaultCredentials because it is false by
default.
Maybe this bit of information will help somebody else if the bug has not yet
been fixed.
So to be safe I am leaving...
defaultCredentials="false"
Out of my web.config for the time being.
Thanks again...
P.S. My apologies, I sent the first reply back to you directly and just
corrected my mistake.
"Juan T. Llibre" <no***********@nowhere.comwrote in message
news:eU*************@TK2MSFTNGP05.phx.gbl...
Might not be meaningful, but you're missing a parameter ...
<smtp deliveryMethod="network" from="jo***@powerlist.com">
You *are* running an ASP.NET 2.0 app, aren't you ?
This only works in ASP.NET 2.0...
Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en espaņol : http://asp.net.do/foros/
===================================
"John Kotuby" <jo***@powerlist.comwrote in message
news:eB*************@TK2MSFTNGP04.phx.gbl...
>Hi all,
Here's a good one. I'm just trying to set up simple email configuration
in web.config so that I can move my site from my development machine to
the production server. I didn't need to pass an ID and Password to the
smtp server at my office, but the Web server I'm using requires it. So I
look into the online help and find no samples of how to set up that type
of configuration. All examples assume default network credentials.
I find the code below in VS help and copy it into my web.config.
<configuration>
<system.net>
<mailSettings>
<smtp deliveryMethod="network">
<network
host="localhost"
port="25"
defaultCredentials="true"
/>
</smtp>
</mailSettings>
</system.net>
</configuration>
Now I get an error on the line <smtp deliveryMethod="network">...
"The deliverymethod attribute is invalid - the value 'network' is invalid
according to its datatype 'NmToken' - the enumeration constraint failed."
It seems that very often even the simplest of tasks can be like pulling
teeth with .NET.
Instead of getting productive work done, I will now be researching
another cryptic VS error message.
What did I do wrong? Does anyone know?
Thanks for any help.