The SMTP server requires a secure connection or the client was not authenticated.

user1544975 picture user1544975 · Aug 3, 2012 · Viewed 16.3k times · Source

I am creating a form using "createuserwizard" in asp.This is my code.

<asp:CreateUserWizard ID="userwizard" ContinueDestinationPageUrl="~/secretfiles/secret.aspx" runat="server" >
    <MailDefinition BodyFileName="register.txt" Subject="Registration Confirmation" From="[email protected]" />
    </asp:CreateUserWizard>

This is my web.config file settings.

 <mailSettings>
      <smtp deliveryMethod="Network" from="[email protected]">
        <network host="smtp.gmail.com" port="25" userName="[email protected]" password="sending emails's password" />
      </smtp>
    </mailSettings>

Then settled up a Smtp .in ISS settings i selected following options.

->Use localhost(SMTP)
->port=25
->authentication not required 

Now when a new user click submit button ,it gives following error message and mail is not being send.

The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. ud8sm21095949igb.4

Please help guys.

Answer

Lunik picture Lunik · Aug 3, 2012

Use enableSsl="true", like this:

 <mailSettings>
  <smtp deliveryMethod="Network" from="[email protected]">
    <network enableSsl="true" host="smtp.gmail.com" port="25" userName="[email protected]" password="sending emails's password" />
  </smtp>
</mailSettings>