SMTP Settings on Production Machine

T

Tushar

Please help: I found some of the following information in messeges in this
group but I would like someone to confirm them please.

I would like to use the following web-services / ASP.Net code to be used in
an intranet environment:

MailMessage Message = new MailMessage();
Message.To = ...
....
SmtpMail.SmtpServer = ...
SmtpMail.Send(Message);

In order for this code to work on a production machine the following IIS
components will be required (is that correct):
1. WWW Server, etc.
2. SMTP Service

Is the [SMTP Service] required even if there is Exchange-Server running on
another server?

In order to making e-mailing work with a domain-user recognised by the
exchange-server, is it true that I need to edit web.config file in the
following way?

<identity
impersonate="true"
userName="DOMAIN\UserName"
password="Password" />

Does this mean that this ASP.Net will use this identity for all server
accesses including database access? Should I be setting database security
for this application using this identity and not the ASPNET user?

Please help and give more info.
 
B

bruce barker

asp.net does not support exchange. it only talks to SMTP, so your exchange
server must host SMTP. The SMTP does not need to be local, just one you have
access to. the standard asp.net mail library does not support any
authentication, if you use the lower level CDO library you can add headers
to support basic.

its common to setup a local SMTP server that talks to the real SMTP server
becuase it can supply authenication.

if you buy a third part email control that supports exchange, you will need
to setup an identity in the web config, but its not used by SMTP.

-- bruce (sqlwork.com)
 
T

Tushar Karsan

Thank you for the reply Bruce.

I am confused, if ASP.Net does not use authentication and I'm currently
using Exchange-Server, be it via SMTP, then how is it sending out emails? I
though Exchange Server requires authentication.

Please help.

regards,
Tushar



asp.net does not support exchange. it only talks to SMTP, so your exchange
server must host SMTP. The SMTP does not need to be local, just one you have
access to. the standard asp.net mail library does not support any
authentication, if you use the lower level CDO library you can add headers
to support basic.

its common to setup a local SMTP server that talks to the real SMTP server
becuase it can supply authenication.

if you buy a third part email control that supports exchange, you will need
to setup an identity in the web config, but its not used by SMTP.

-- bruce (sqlwork.com)



Tushar said:
Please help: I found some of the following information in messeges in this
group but I would like someone to confirm them please.

I would like to use the following web-services / ASP.Net code to be used in
an intranet environment:

MailMessage Message = new MailMessage();
Message.To = ...
...
SmtpMail.SmtpServer = ...
SmtpMail.Send(Message);

In order for this code to work on a production machine the following IIS
components will be required (is that correct):
1. WWW Server, etc.
2. SMTP Service

Is the [SMTP Service] required even if there is Exchange-Server running on
another server?

In order to making e-mailing work with a domain-user recognised by the
exchange-server, is it true that I need to edit web.config file in the
following way?

<identity
impersonate="true"
userName="DOMAIN\UserName"
password="Password" />

Does this mean that this ASP.Net will use this identity for all server
accesses including database access? Should I be setting database security
for this application using this identity and not the ASPNET user?

Please help and give more info.
 
K

Klaus H. Probst

In order for this code to work on a production machine the following IIS
components will be required (is that correct):
1. WWW Server, etc.
2. SMTP Service

On Windows 2000 and 2003 the classes in System.Web.Mail are essentially
wrappers for the CDOSYS library. I don't think IIS installs CDOSYS, though I
might be wrong about that. I believe it's part of the server itself.
Is the [SMTP Service] required even if there is Exchange-Server running on
another server?

No, the local SMTP is only needed if you are using it as a pickup/relay
system to another "smart host", typically an Exchange server. If you're
doing SMTP directly to the Exchange box then there's no need for it.
In order to making e-mailing work with a domain-user recognised by the
exchange-server, is it true that I need to edit web.config file in the
following way?

No, that depends on the Exchange server configuration. Normally it's
configured to relay mail only from a set of IP addresses (i.e., your
intranet), and more often than not they also require a valid domain address
(though not a mailbox). So you can send mail from '(e-mail address removed)' and
if the Exchange box accepts that then you should be OK. It has nothing to do
with NT security.
Does this mean that this ASP.Net will use this identity for all server
accesses including database access? Should I be setting database security
for this application using this identity and not the ASPNET user?

You don't need it, so the database authentication is another matter.
Personally I tend to stay away from integrated authentication and just use a
standard SQL Server login/password to connect to the database.
 
T

Tushar

Thanks

Klaus H. Probst said:
In order for this code to work on a production machine the following IIS
components will be required (is that correct):
1. WWW Server, etc.
2. SMTP Service

On Windows 2000 and 2003 the classes in System.Web.Mail are essentially
wrappers for the CDOSYS library. I don't think IIS installs CDOSYS, though I
might be wrong about that. I believe it's part of the server itself.
Is the [SMTP Service] required even if there is Exchange-Server running on
another server?

No, the local SMTP is only needed if you are using it as a pickup/relay
system to another "smart host", typically an Exchange server. If you're
doing SMTP directly to the Exchange box then there's no need for it.
In order to making e-mailing work with a domain-user recognised by the
exchange-server, is it true that I need to edit web.config file in the
following way?

No, that depends on the Exchange server configuration. Normally it's
configured to relay mail only from a set of IP addresses (i.e., your
intranet), and more often than not they also require a valid domain address
(though not a mailbox). So you can send mail from '(e-mail address removed)' and
if the Exchange box accepts that then you should be OK. It has nothing to do
with NT security.
Does this mean that this ASP.Net will use this identity for all server
accesses including database access? Should I be setting database security
for this application using this identity and not the ASPNET user?

You don't need it, so the database authentication is another matter.
Personally I tend to stay away from integrated authentication and just use a
standard SQL Server login/password to connect to the database.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,816
Latest member
nipsseyhussle

Latest Threads

Top