atfinho
4 months ago

Sending mail issue

Posted 4 months ago by atfinho

Hey guys , I'm trying to send an email with smtp but I'm keep getting an error

Failed to authenticate on SMTP server with username "[email protected]" using 3 possible authenticators. Authenticator LOGIN returned Expected response code 235 but got code "534"

even though I allowed : less secure apps , 2 steps validation, unlocked captcha

but the error keeps persist !

this is the function

 $data = array('name'=>"Name");
      Mail::send('emails.welcome', $data, function($message) {
         $message->to('[email protected]', 'Tutorials Point')->subject
            ('Laravel HTML Testing Mail');
         $message->from('[email protected]','Sender');
      });
      echo "HTML Email Sent. Check your inbox.";

and this my .env

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=myemail
MAIL_PASSWORD=mypass
MAIL_ENCRYPTION=tls

Please sign in or create an account to participate in this conversation.