Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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. k12sm3795394wby.16

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: 5.7.0 Must issue a STARTTLS command first. k12sm3795394wby.16

Source Error:

I am using createUserWizard.. it has a mailing option in its properties that i set using the designer (VS2010). When I used code it worked!, but with that control it doesnt. I wonder why!!

Here is my web.config file:

<system.net>
    <mailSettings>
        <smtp from="[email protected]">
            <network host="smtp.gmail.com" defaultCredentials="false"
             port="587" userName="**********" password="*****"/>
        </smtp>
    </mailSettings>
</system.net>

But I doubt the control uses that setting.

like image 447
Dmitry Makovetskiyd Avatar asked May 23 '11 12:05

Dmitry Makovetskiyd


People also ask

How do you resolve the SMTP server requires a secure connection or the client was not authenticated the server response was 5.7 0 authentication required Learn more at?

Use smtp.gmail.com instead of smtp.google.com. Use port 587. Set client. UseDefaultCredentials = false; before setting credentials.

How do I fix SMTP authentication?

From the Tools menu, choose Account Settings. Select your email account from the list, then click Change. On the Change E-mail Settings window, click More Settings. Click the Outgoing Server tab, then check the My outgoing server (SMTP) requires authentication option.

How do I enable SSL authentication for SMTP connection?

To enable SSL support, set the ALWAUTH parameter to either *LCLRLY or *RELAY using the Change SMTP Attributes (CHGSMTPA) command. If you set the parameter to *RELAY, only e-mails sent from the other SMTP server support the use of SSL.


1 Answers

Gmail requires you to use a secure connection. This can be set in your web.config like this:

<network host="smtp.gmail.com" enableSsl="true" ... />
like image 75
Dennis Traub Avatar answered Oct 16 '22 21:10

Dennis Traub