Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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 is my code:

Mail::send(
    'emails.order.order',
    array(
        'dateTime'  => $dateTime,
        'items'     => $items
    ),
    function($message) use ($toEmail, $toName) {
        $message->from('my@email.com', 'My Company');

        $message->to($toEmail, $toName);
        $message->bcc('mybcc@email.com');

        $message->subject('New order');
    }
);
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
624 views
Welcome To Ask or Share your Answers For Others

1 Answer

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);


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...