T
T
ThreegunD2017-03-30 19:25:57
Laravel
ThreegunD, 2017-03-30 19:25:57

Sending mail from Laravel?

I put the driver in "mail" (I tried it in the log, the message was displayed)
But for some reason this design does not work

$mail = Mail::send('order.email', ['request' => $request], function ($message){
            $mailAdmin = env('MAIL_ADMIN');
            $userMail = Auth::user()->email;
            $userName = Auth::user()->name;
            $message->from($userMail, $userName);
            $message->to($mailAdmin)->subject('subject');
        });

Although this works
$adminEmail = '[email protected]';
                    $subject = 'Тема';
                    $body_message = 'Hello world!"; 
                    mail($adminEmail, $subject, $body_message);

What am I doing wrong in the end?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question