problem sending email from web form

Discussion in 'ASP.NET 2.0' started by torontoapple, May 12, 2007.

  1. I am getting the following error when I tried to sent the result from my web form to my email:



    The SMTP server requires a secure connection or the client was not authenticated. The server response was: authentication needed Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Net.Mail.SmtpException: The SMTP server requires a secure connection or the client was not authenticated. The server response was: authentication needed

    Source Error:





    Code:
    Line 33:             Dim smtp As New SmtpClient
    Line 34:             '(4) Send the MailMessage (will use the Web.config settings)
    Line 35:             smtp.Send(mm)
    Line 36: 
    Line 37:             mm.Dispose()



    I have my web.config specified as follow:


    <system.net>


    <mailSettings>


    <smtp from=[email protected]>


    <network host="smtp.my-domain.com" password="my-password" userName="my-login" />


    </smtp>


    </mailSettings>


    </system.net>


    Please help. Thanks.
     
  2. I found it. I should set the smtp to localhost.
     

Share This Page