vendredi 2 juin 2017

got error- "250 but got code "530", with message "530-5.5.1 Authentication Required" when try to send mail from local host

I have been wandering for about 3 days to make a contact form. I found so many post here related to my problem but all are proved useless. That's why i compelled to post here. May be it is duplicate question but i posted here to show you my code if any mistake i made. I am using laravel 5.4.

i changed my gmail setting regarding all i found in stackoverflow post. But still see the error.

enter image description here enter image description here

enter image description here

mailable class:

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;

class ContactForm extends Mailable
{
    use Queueable, SerializesModels;

    public function __construct()
    {
        //
    }


    public function build()
    {
        return $this->view('home.confirm');
    }
}

.env:

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

config/mail:

<?php

return [

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


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

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



'from' => [
    'address' => env('MAIL_FROM_ADDRESS', 'idbr27diit@gmail.com'),
    'name' => env('MAIL_FROM_NAME', 'Example'),
],



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



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

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



'sendmail' => '/usr/sbin/sendmail -bs',
"pretend" => false,



'markdown' => [
    'theme' => 'default',

    'paths' => [
        resource_path('views/vendor/mail'),
    ],
],

];

Any mistake i made?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2qPgFb0
via IFTTT

Aucun commentaire:

Enregistrer un commentaire