문제

Currently this is how the headers look like. What should I do if I want to add a bcc. Thanks for the help. Below is what the code looks like.

// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: PHP/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers); 
?>
도움이 되었습니까?

해결책

You would add this in the headers:

'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'Bcc: someone@example.com' . "\r\n" . 
'X-Mailer: PHP/' . phpversion();

As shown on the docs at PHP.net

다른 팁

This is how my Mail function looks, with Bcc and cc

//Send email
Mail::send('emails.contactus',
     array(
            'name'         => $request->get('fname'),
            'designation'  => $request->get('jobtitle'),
            'orgn'         => $request->get('orgn'),
            'phone'        => request('countrycode')
        ), 
        function($message) use ($request)
        {
            $message->from('hello@xxxx.com','Name');
            $message->to('support@xxx.com', 'Name')->subject('New Enquiry from Website');
            $message->cc('rajiv@xxx.me');
            $message->Bcc('rajiv@xxx.me');
        });
    
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top