Laravel mail bcc

前端 未结 2 1715
没有蜡笔的小新
没有蜡笔的小新 2021-01-03 23:59

I am using the default Laravel Mail class to send emails.

I am trying to add bcc to myself, but when I add a bcc the email is not send at all.
Here

相关标签:
2条回答
  • 2021-01-04 00:15

    As Ivan Dokov said, you need to pass the email and name to the bcc function. You could also shorten your code by doing this

      function($message) use ($toEmail, $toName) {
            $message->from('my@email.com', 'My Company')
                    ->to($toEmail, $toName)
                    ->bcc('mybcc@email.com','My bcc Name')
                    ->subject('New order');
        }
    
    0 讨论(0)
  • 2021-01-04 00:18

    I have found the problem.
    I didn't use the correct parameters for $message->bcc('mybcc@email.com');

    I had to write email AND name: $message->bcc('mybcc@email.com', 'My Name');
    The same way as I use $message->to($toEmail, $toName);

    0 讨论(0)
提交回复
热议问题