Sendimg e-mail by form with SMTP setting in web.config (ASP.NET 3.5)

Discussion in 'Email' started by Ady2010, Feb 9, 2010.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. Hi,

    I can't send e-mail with SMTP. Don't know what is wrong in my doe.

    In web.config I wrote the SMTP I will be using:

    <system.net>
    <mailSettings>
    <smtp>
    <network host="smtp.mydomain.com" port="587" userName="[email protected]" password="password" />
    </smtp>
    </mailSettings>
    </system.net>

    But it seems something is wrong. I get this:
    Exception Details: System.InvalidOperationException: The SMTP host was not specified.

    What I'm doing wrong?
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    set the SMTP host to "localhost" and port to "25". you do not need to specify a username / password.
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page