Skip to content

Getting the local smtp host name

Jason

Asked Oct 1, 2008, 5:05 PM EDT4 answers
Share
LinkedInX

I have an application that allows the user to send me an email.  How can I have the application programatically determine the users local smtp host for use with the SmtpClient() object?

Jason

3 Answers

Know the answer? Post it. Somebody with the same question will find it here.

  • Niradhip Chakraborty
    +1
    You can specify the smtp settings in web.config file. Provide host,username and password like below.
    +1
  • +1

    Would you provide me with a simple example of how to do this?

    Jason

    +1
  • Niradhip Chakraborty
    +1
    <system.net>
      <mailSettings>
       <smtp>
        <network host="SMTP.1and1.com" userName="[email protected]" password="sam"/>
       </smtp>
      </mailSettings>
     </system.net>
    +1
  • 1 short reply
    • +1

      Anyone?

      Jason

      +1