0

This is my code:

<?php
$to = "you@example.com";
$subject = "This is the subject!";
$message = "This is the message!";
$headers = 'From: Me<me@example.com>' . "\r\n";
$headers .= 'Bcc: me@example.com' . "\r\n";
mail($to,$subject,$message,$headers);
?>

Unfortunately I'm not getting the Bcc email. Why that? What am I doing wrong?

  • `BCC` should be part of the header, not a different parameter. See http://php.net/manual/en/function.mail.php. Specifically `$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";`. – chris85 Oct 23 '16 at 16:28
  • Look [at the flippin manual](http://php.net/manual/en/function.mail.php) there is a perfectly good example in there – RiggsFolly Oct 23 '16 at 16:29
  • Hey @chris85, did you mean like that? `$to = "you@example.com";` `$subject = "This is the subject!";` `$message = "This is the message!";` `$headers .= 'From: Me' . "\r\n";` $headers .= 'Bcc: me@example.com' . "\r\n"; `mail($to,$subject,$message,$headers);` –  Oct 23 '16 at 16:35
  • Yea, something like that, is that from the manual? You can edit the question, http://stackoverflow.com/posts/40205117/edit and add an update if you are having different issues. – chris85 Oct 23 '16 at 16:36
  • @chris85, I updated my question. Can you help me? –  Oct 23 '16 at 17:29

0 Answers0