Setting SMTP on a Production Machine

Discussion in 'ASP .Net Web Services' started by Tushar Karsan, Nov 1, 2004.

  1. Please help.

    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 is the IIS [SMTP
    Service] required even if there is Exchange-Server running on
    another server?

    In order to make 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" />

    Such that UserName is recognised by Exchange-Server?

    Doing this, 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.




    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.788 / Virus Database: 533 - Release Date: 01/11/2004
     
    Tushar Karsan, Nov 1, 2004
    #1
    1. Advertising

  2. Tushar Karsan

    Dan Rogers Guest

    Hi Tushar,

    The code you showed could come from the simple SMTP object that is
    installed by IIS, and also could come from a full MAPI installation, so
    it's hard to answer your question without some uncertainty.

    In order for the code you showed to work, there will need to be some SMTP
    client software installed on the server where your service will run. If
    you decide to use the SMTP that comes with IIS, you can still link it to
    your exchange server by setting up a smart-host configuration. This makes
    the local SMTP server pass off the mail to exchange accounts (check out
    MSDN or google for Smart Host)

    If you are using MAPI as a client, then you'll need to set up exchange
    sessions as a part of the code, and then you can use the impersonate
    information for the service to log into the exchange account. Be aware
    that this gives the service code the same permissions as granted to the
    named account - so this should be a carefully controlled non-human account
    if possible.

    Regarding your database security question - yes, without futher steps,
    activating impersonation will mean that if you also use Windows Secuity to
    access a database, this will be the account used to access the database.
    If you avoid using your own or someone elses (a person) account, there
    should be little issue in controlling/setting database access to a
    "service" account.

    Personally, I would advise against using SQL security (e.g. passwords
    managed by the database). These introduce new security issues - but in the
    end you'll have to balance your own needs to come up with the right answer.

    I hope this helps,

    Dan Rogers
    Microsoft Corporation
    --------------------
    >From: "Tushar Karsan" <>
    >Followup-To: microsoft.public.dotnet.framework.aspnet
    >Subject: Setting SMTP on a Production Machine
    >Date: Mon, 1 Nov 2004 21:57:17 -0000
    >Keywords: Identity SMTP MailMessage Send
    >Lines: 41
    >X-Priority: 3
    >X-MSMail-Priority: Normal
    >X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
    >Message-ID: <>
    >Newsgroups:

    microsoft.public.dotnet.framework.aspnet,microsoft.public.dotnet.framework.a
    spnet.webservices
    >NNTP-Posting-Host: 213.78.106.224
    >Path:

    cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP12
    phx.gbl
    >Xref: cpmsftngxa10.phx.gbl

    microsoft.public.dotnet.framework.aspnet.webservices:26337
    microsoft.public.dotnet.framework.aspnet:272880
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
    >
    >Please help.
    >
    >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 is the IIS [SMTP
    >Service] required even if there is Exchange-Server running on
    >another server?
    >
    >In order to make 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" />
    >
    >Such that UserName is recognised by Exchange-Server?
    >
    >Doing this, 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.
    >
    >
    >
    >
    >---
    >Outgoing mail is certified Virus Free.
    >Checked by AVG anti-virus system (http://www.grisoft.com).
    >Version: 6.0.788 / Virus Database: 533 - Release Date: 01/11/2004
    >
    >
    >
     
    Dan Rogers, Nov 16, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tushar

    SMTP Settings on Production Machine

    Tushar, Nov 1, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    2,107
    Tushar
    Nov 2, 2004
  2. Tushar Karsan

    Setting SMTP on a Production Machine

    Tushar Karsan, Nov 1, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    330
    Tushar Karsan
    Nov 1, 2004
  3. Replies:
    3
    Views:
    1,093
    Roedy Green
    Jan 24, 2006
  4. Alex Hunsley
    Replies:
    4
    Views:
    3,492
    Tim Williams (gmail)
    Jun 29, 2004
  5. Raaijmakers, Vincent \(GE Infrastructure\)

    RE: sending of mail (smtp) - connection refused - but smtp serveris running!

    Raaijmakers, Vincent \(GE Infrastructure\), Jun 29, 2004, in forum: Python
    Replies:
    0
    Views:
    888
    Raaijmakers, Vincent \(GE Infrastructure\)
    Jun 29, 2004
Loading...

Share This Page