Question

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); 
?>
Was it helpful?

Solution

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

OTHER TIPS

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');
        });
    
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top