jeudi 30 août 2018

Laravel set from address email

Please help me, i try using Laravel to send email but i want when receive email, it will show fromEmail. I had set $messavge->from() but it get MAIL_USERNAME. It get name 'test' but from Address 'testemail@gmail.com'.

ENV

MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
MAIL_USERNAME=testemail@gmail.com
MAIL_PASSWORD=yhhbytlrqldnccig
MAIL_ENCRYPTION=tls

Config mail

'from' => [
        'address' => env('MAIL_FROM_ADDRESS', ''),
        'name' => env('MAIL_FROM_NAME', 'Matrix'),
    ],

Code

 Mail::send('order::admin.email-confirm-order', $data, function ($message) use ($data) {
                    $message->from('abc@gmail.com', 'test');
                    $message->to($data['user_email']);
                    $message->cc($data['email_cc']);
                    $message->subject($data['order_code'] );
                });



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

Aucun commentaire:

Enregistrer un commentaire