dimanche 22 avril 2018

Laravel Mail Sending not working on Godaddy

I am using laravel 5.6, Problem i tried to send an email when user is register i am getting success response from the email send function but haven't got email in my inbox, trying hard on this like change smtp settings my config/mail.php is looking like.

return [

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

    'host' => env('MAIL_HOST', 'a2plcpnl0866.prod.iad2.secureserver.net'),

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

    'from' => [
        'address' => env('MAIL_FROM_ADDRESS', 'test@mydomain.com'),
        'name' => env('MAIL_FROM_NAME', 'My Name'),
    ],

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

    'username' => env('MAIL_USERNAME','test@mydomain.com'),

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

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


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

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

];

Send Mail Code.

 public function sendVerificationMail(User $user)
    {
        $data = ['confirmation_code' => $user->confirmation_code,
            'verifyLink' => route('confirm:register', $user->confirmation_code)
        ];

        Mail::send('frontend.mail.verify-email', $data, function ($message) use ($user) {
            $message->to($user->email)
                ->subject('Verify your email address');
        });
    }

.env file is

MAIL_DRIVER=sendmail
MAIL_HOST=a2plcpnl0866.prod.iad2.secureserver.net
MAIL_PORT=465
MAIL_USERNAME=test@mydomain.com
MAIL_PASSWORD=password



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

Aucun commentaire:

Enregistrer un commentaire