Laravel, Failed to authenticate on SMTP server with username “” using 3 possible authenticators











up vote
0
down vote

favorite












I am trying to find out why this happens.




.env




MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=*******t@gmail.com
MAIL_PASSWORD=******
MAIL_ENCRYPTION=tls



mail.php




<?php
return [

'driver' => env('MAIL_DRIVER', 'smtp'),

'host' => env('MAIL_HOST', 'smtp.gmail.com'),

'port' => env('MAIL_PORT', 587),

'from' => ['address' => '******@gmail.com', 'name' => 'Project'],

'encryption' => env('MAIL_ENCRYPTION', 'tls'),

'username' => env('******@gmail.com'),

'password' => env('******'),

'sendmail' => '/usr/sbin/sendmail -bs',

'pretend' => false,
'stream' => [
'ssl' => [
'allow_self_signed' => true,
'verify_peer' => false,
'verify_peer_name' => false,
],
],
];



This is the error




Failed to authenticate on SMTP server with username "" using 3 possible authenticators. Authenticator LOGIN returned Swift_TransportExce ▶
534-5.7.14 GVHg3-rU8SDpVLdwnIPviBCjKNnBRcxuU2N3-pcUWd0TeMbM_vULrHhQcVNXjhoewjrquWrn
534-5.7.14 Jttd6jNXfnledZiAMv-rjMvpnd01nas-2J2BYU_Krd4kzT-YmTR_HW9uW3S6Ts2jUxDaC8rn
534-5.7.14 XmT_TV9QqYXHXkTMcrX3OG9D4QyF4E6w7fwnu2bYZT36rZXTU-HqJwlWzJBv8-MC2P9xrNrn
534-5.7.14 cUd4-BirG0rfAjlDxy5bkbon3S_bIFSZQVd0-5wskctUR4do7F> Please log in viarn
534-5.7.14 your web browser and then try again.rn
534-5.7.14 Learn more atrn
534 5.7.14 https://support.google.com/mail/answer/78754 l5-v6sm1366079wrv.84 - gsmtprn
" in C:xampphtdocswerwalrervendorswiftmailerswiftmailerlibclassesSwiftTransportAbstractSmtpTransport.php:457n
Stack trace:n



I checked email credentials and they are the same. In this project I
have used authentication , but can't find a solution to this one.











share|improve this question


























    up vote
    0
    down vote

    favorite












    I am trying to find out why this happens.




    .env




    MAIL_DRIVER=smtp
    MAIL_HOST=smtp.gmail.com
    MAIL_PORT=587
    MAIL_USERNAME=*******t@gmail.com
    MAIL_PASSWORD=******
    MAIL_ENCRYPTION=tls



    mail.php




    <?php
    return [

    'driver' => env('MAIL_DRIVER', 'smtp'),

    'host' => env('MAIL_HOST', 'smtp.gmail.com'),

    'port' => env('MAIL_PORT', 587),

    'from' => ['address' => '******@gmail.com', 'name' => 'Project'],

    'encryption' => env('MAIL_ENCRYPTION', 'tls'),

    'username' => env('******@gmail.com'),

    'password' => env('******'),

    'sendmail' => '/usr/sbin/sendmail -bs',

    'pretend' => false,
    'stream' => [
    'ssl' => [
    'allow_self_signed' => true,
    'verify_peer' => false,
    'verify_peer_name' => false,
    ],
    ],
    ];



    This is the error




    Failed to authenticate on SMTP server with username "" using 3 possible authenticators. Authenticator LOGIN returned Swift_TransportExce ▶
    534-5.7.14 GVHg3-rU8SDpVLdwnIPviBCjKNnBRcxuU2N3-pcUWd0TeMbM_vULrHhQcVNXjhoewjrquWrn
    534-5.7.14 Jttd6jNXfnledZiAMv-rjMvpnd01nas-2J2BYU_Krd4kzT-YmTR_HW9uW3S6Ts2jUxDaC8rn
    534-5.7.14 XmT_TV9QqYXHXkTMcrX3OG9D4QyF4E6w7fwnu2bYZT36rZXTU-HqJwlWzJBv8-MC2P9xrNrn
    534-5.7.14 cUd4-BirG0rfAjlDxy5bkbon3S_bIFSZQVd0-5wskctUR4do7F> Please log in viarn
    534-5.7.14 your web browser and then try again.rn
    534-5.7.14 Learn more atrn
    534 5.7.14 https://support.google.com/mail/answer/78754 l5-v6sm1366079wrv.84 - gsmtprn
    " in C:xampphtdocswerwalrervendorswiftmailerswiftmailerlibclassesSwiftTransportAbstractSmtpTransport.php:457n
    Stack trace:n



    I checked email credentials and they are the same. In this project I
    have used authentication , but can't find a solution to this one.











    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am trying to find out why this happens.




      .env




      MAIL_DRIVER=smtp
      MAIL_HOST=smtp.gmail.com
      MAIL_PORT=587
      MAIL_USERNAME=*******t@gmail.com
      MAIL_PASSWORD=******
      MAIL_ENCRYPTION=tls



      mail.php




      <?php
      return [

      'driver' => env('MAIL_DRIVER', 'smtp'),

      'host' => env('MAIL_HOST', 'smtp.gmail.com'),

      'port' => env('MAIL_PORT', 587),

      'from' => ['address' => '******@gmail.com', 'name' => 'Project'],

      'encryption' => env('MAIL_ENCRYPTION', 'tls'),

      'username' => env('******@gmail.com'),

      'password' => env('******'),

      'sendmail' => '/usr/sbin/sendmail -bs',

      'pretend' => false,
      'stream' => [
      'ssl' => [
      'allow_self_signed' => true,
      'verify_peer' => false,
      'verify_peer_name' => false,
      ],
      ],
      ];



      This is the error




      Failed to authenticate on SMTP server with username "" using 3 possible authenticators. Authenticator LOGIN returned Swift_TransportExce ▶
      534-5.7.14 GVHg3-rU8SDpVLdwnIPviBCjKNnBRcxuU2N3-pcUWd0TeMbM_vULrHhQcVNXjhoewjrquWrn
      534-5.7.14 Jttd6jNXfnledZiAMv-rjMvpnd01nas-2J2BYU_Krd4kzT-YmTR_HW9uW3S6Ts2jUxDaC8rn
      534-5.7.14 XmT_TV9QqYXHXkTMcrX3OG9D4QyF4E6w7fwnu2bYZT36rZXTU-HqJwlWzJBv8-MC2P9xrNrn
      534-5.7.14 cUd4-BirG0rfAjlDxy5bkbon3S_bIFSZQVd0-5wskctUR4do7F> Please log in viarn
      534-5.7.14 your web browser and then try again.rn
      534-5.7.14 Learn more atrn
      534 5.7.14 https://support.google.com/mail/answer/78754 l5-v6sm1366079wrv.84 - gsmtprn
      " in C:xampphtdocswerwalrervendorswiftmailerswiftmailerlibclassesSwiftTransportAbstractSmtpTransport.php:457n
      Stack trace:n



      I checked email credentials and they are the same. In this project I
      have used authentication , but can't find a solution to this one.











      share|improve this question













      I am trying to find out why this happens.




      .env




      MAIL_DRIVER=smtp
      MAIL_HOST=smtp.gmail.com
      MAIL_PORT=587
      MAIL_USERNAME=*******t@gmail.com
      MAIL_PASSWORD=******
      MAIL_ENCRYPTION=tls



      mail.php




      <?php
      return [

      'driver' => env('MAIL_DRIVER', 'smtp'),

      'host' => env('MAIL_HOST', 'smtp.gmail.com'),

      'port' => env('MAIL_PORT', 587),

      'from' => ['address' => '******@gmail.com', 'name' => 'Project'],

      'encryption' => env('MAIL_ENCRYPTION', 'tls'),

      'username' => env('******@gmail.com'),

      'password' => env('******'),

      'sendmail' => '/usr/sbin/sendmail -bs',

      'pretend' => false,
      'stream' => [
      'ssl' => [
      'allow_self_signed' => true,
      'verify_peer' => false,
      'verify_peer_name' => false,
      ],
      ],
      ];



      This is the error




      Failed to authenticate on SMTP server with username "" using 3 possible authenticators. Authenticator LOGIN returned Swift_TransportExce ▶
      534-5.7.14 GVHg3-rU8SDpVLdwnIPviBCjKNnBRcxuU2N3-pcUWd0TeMbM_vULrHhQcVNXjhoewjrquWrn
      534-5.7.14 Jttd6jNXfnledZiAMv-rjMvpnd01nas-2J2BYU_Krd4kzT-YmTR_HW9uW3S6Ts2jUxDaC8rn
      534-5.7.14 XmT_TV9QqYXHXkTMcrX3OG9D4QyF4E6w7fwnu2bYZT36rZXTU-HqJwlWzJBv8-MC2P9xrNrn
      534-5.7.14 cUd4-BirG0rfAjlDxy5bkbon3S_bIFSZQVd0-5wskctUR4do7F> Please log in viarn
      534-5.7.14 your web browser and then try again.rn
      534-5.7.14 Learn more atrn
      534 5.7.14 https://support.google.com/mail/answer/78754 l5-v6sm1366079wrv.84 - gsmtprn
      " in C:xampphtdocswerwalrervendorswiftmailerswiftmailerlibclassesSwiftTransportAbstractSmtpTransport.php:457n
      Stack trace:n



      I checked email credentials and they are the same. In this project I
      have used authentication , but can't find a solution to this one.








      php laravel






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 7 at 16:59









      alphal

      56




      56
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          2
          down vote













          I think there is something wrong with your mail.php file.



          You should be passing the variable names to the env() function for username and password.



          So this:



          'username' => env('******@gmail.com'),

          'password' => env('******'),


          Becomes this:



          'username' => env('MAIL_USERNAME'),

          'password' => env('MAIL_PASSWORD'),





          share|improve this answer

















          • 1




            Yup, this looks like it. Or just 'username' => '******@gmail.com', if you're really wanting to hard-code it.
            – ceejayoz
            Nov 7 at 17:10




















          up vote
          0
          down vote













          Your .env file looks good.



          You mail.php file should look like this:



          <?php
          return [

          'driver' => env('MAIL_DRIVER', 'smtp'),

          'host' => env('MAIL_HOST', 'smtp.gmail.com'),

          'port' => env('MAIL_PORT', 587),

          'from' => ['address' => '******@gmail.com', 'name' => 'Project'],

          'encryption' => env('MAIL_ENCRYPTION', 'tls'),

          'username' => env('MAIL_USERNAME', '******@gmail.com'),

          'password' => env('MAIL_PASSWORD', '******'),

          'sendmail' => '/usr/sbin/sendmail -bs',

          'pretend' => false,
          'stream' => [
          'ssl' => [
          'allow_self_signed' => true,
          'verify_peer' => false,
          'verify_peer_name' => false,
          ],
          ],
          ];


          The value in the second parameter for the env() function, gets used if the .env key specified in the first parameter is not found.






          share|improve this answer





















            Your Answer






            StackExchange.ifUsing("editor", function () {
            StackExchange.using("externalEditor", function () {
            StackExchange.using("snippets", function () {
            StackExchange.snippets.init();
            });
            });
            }, "code-snippets");

            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "1"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














             

            draft saved


            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53194262%2flaravel-failed-to-authenticate-on-smtp-server-with-username-using-3-possible%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes








            up vote
            2
            down vote













            I think there is something wrong with your mail.php file.



            You should be passing the variable names to the env() function for username and password.



            So this:



            'username' => env('******@gmail.com'),

            'password' => env('******'),


            Becomes this:



            'username' => env('MAIL_USERNAME'),

            'password' => env('MAIL_PASSWORD'),





            share|improve this answer

















            • 1




              Yup, this looks like it. Or just 'username' => '******@gmail.com', if you're really wanting to hard-code it.
              – ceejayoz
              Nov 7 at 17:10

















            up vote
            2
            down vote













            I think there is something wrong with your mail.php file.



            You should be passing the variable names to the env() function for username and password.



            So this:



            'username' => env('******@gmail.com'),

            'password' => env('******'),


            Becomes this:



            'username' => env('MAIL_USERNAME'),

            'password' => env('MAIL_PASSWORD'),





            share|improve this answer

















            • 1




              Yup, this looks like it. Or just 'username' => '******@gmail.com', if you're really wanting to hard-code it.
              – ceejayoz
              Nov 7 at 17:10















            up vote
            2
            down vote










            up vote
            2
            down vote









            I think there is something wrong with your mail.php file.



            You should be passing the variable names to the env() function for username and password.



            So this:



            'username' => env('******@gmail.com'),

            'password' => env('******'),


            Becomes this:



            'username' => env('MAIL_USERNAME'),

            'password' => env('MAIL_PASSWORD'),





            share|improve this answer












            I think there is something wrong with your mail.php file.



            You should be passing the variable names to the env() function for username and password.



            So this:



            'username' => env('******@gmail.com'),

            'password' => env('******'),


            Becomes this:



            'username' => env('MAIL_USERNAME'),

            'password' => env('MAIL_PASSWORD'),






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 7 at 17:05









            Camilo

            1,9061226




            1,9061226








            • 1




              Yup, this looks like it. Or just 'username' => '******@gmail.com', if you're really wanting to hard-code it.
              – ceejayoz
              Nov 7 at 17:10
















            • 1




              Yup, this looks like it. Or just 'username' => '******@gmail.com', if you're really wanting to hard-code it.
              – ceejayoz
              Nov 7 at 17:10










            1




            1




            Yup, this looks like it. Or just 'username' => '******@gmail.com', if you're really wanting to hard-code it.
            – ceejayoz
            Nov 7 at 17:10






            Yup, this looks like it. Or just 'username' => '******@gmail.com', if you're really wanting to hard-code it.
            – ceejayoz
            Nov 7 at 17:10














            up vote
            0
            down vote













            Your .env file looks good.



            You mail.php file should look like this:



            <?php
            return [

            'driver' => env('MAIL_DRIVER', 'smtp'),

            'host' => env('MAIL_HOST', 'smtp.gmail.com'),

            'port' => env('MAIL_PORT', 587),

            'from' => ['address' => '******@gmail.com', 'name' => 'Project'],

            'encryption' => env('MAIL_ENCRYPTION', 'tls'),

            'username' => env('MAIL_USERNAME', '******@gmail.com'),

            'password' => env('MAIL_PASSWORD', '******'),

            'sendmail' => '/usr/sbin/sendmail -bs',

            'pretend' => false,
            'stream' => [
            'ssl' => [
            'allow_self_signed' => true,
            'verify_peer' => false,
            'verify_peer_name' => false,
            ],
            ],
            ];


            The value in the second parameter for the env() function, gets used if the .env key specified in the first parameter is not found.






            share|improve this answer

























              up vote
              0
              down vote













              Your .env file looks good.



              You mail.php file should look like this:



              <?php
              return [

              'driver' => env('MAIL_DRIVER', 'smtp'),

              'host' => env('MAIL_HOST', 'smtp.gmail.com'),

              'port' => env('MAIL_PORT', 587),

              'from' => ['address' => '******@gmail.com', 'name' => 'Project'],

              'encryption' => env('MAIL_ENCRYPTION', 'tls'),

              'username' => env('MAIL_USERNAME', '******@gmail.com'),

              'password' => env('MAIL_PASSWORD', '******'),

              'sendmail' => '/usr/sbin/sendmail -bs',

              'pretend' => false,
              'stream' => [
              'ssl' => [
              'allow_self_signed' => true,
              'verify_peer' => false,
              'verify_peer_name' => false,
              ],
              ],
              ];


              The value in the second parameter for the env() function, gets used if the .env key specified in the first parameter is not found.






              share|improve this answer























                up vote
                0
                down vote










                up vote
                0
                down vote









                Your .env file looks good.



                You mail.php file should look like this:



                <?php
                return [

                'driver' => env('MAIL_DRIVER', 'smtp'),

                'host' => env('MAIL_HOST', 'smtp.gmail.com'),

                'port' => env('MAIL_PORT', 587),

                'from' => ['address' => '******@gmail.com', 'name' => 'Project'],

                'encryption' => env('MAIL_ENCRYPTION', 'tls'),

                'username' => env('MAIL_USERNAME', '******@gmail.com'),

                'password' => env('MAIL_PASSWORD', '******'),

                'sendmail' => '/usr/sbin/sendmail -bs',

                'pretend' => false,
                'stream' => [
                'ssl' => [
                'allow_self_signed' => true,
                'verify_peer' => false,
                'verify_peer_name' => false,
                ],
                ],
                ];


                The value in the second parameter for the env() function, gets used if the .env key specified in the first parameter is not found.






                share|improve this answer












                Your .env file looks good.



                You mail.php file should look like this:



                <?php
                return [

                'driver' => env('MAIL_DRIVER', 'smtp'),

                'host' => env('MAIL_HOST', 'smtp.gmail.com'),

                'port' => env('MAIL_PORT', 587),

                'from' => ['address' => '******@gmail.com', 'name' => 'Project'],

                'encryption' => env('MAIL_ENCRYPTION', 'tls'),

                'username' => env('MAIL_USERNAME', '******@gmail.com'),

                'password' => env('MAIL_PASSWORD', '******'),

                'sendmail' => '/usr/sbin/sendmail -bs',

                'pretend' => false,
                'stream' => [
                'ssl' => [
                'allow_self_signed' => true,
                'verify_peer' => false,
                'verify_peer_name' => false,
                ],
                ],
                ];


                The value in the second parameter for the env() function, gets used if the .env key specified in the first parameter is not found.







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Nov 7 at 17:30









                Elisha Senoo

                1,0361716




                1,0361716






























                     

                    draft saved


                    draft discarded



















































                     


                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53194262%2flaravel-failed-to-authenticate-on-smtp-server-with-username-using-3-possible%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    這個網誌中的熱門文章

                    Tangent Lines Diagram Along Smooth Curve

                    Yusuf al-Mu'taman ibn Hud

                    Zucchini