Adding BCC in PHP's mail function -
ok have, need send email address blind cc of email. ideas? have tried using $bcc alternative , doesn't seem work me. , rather have each didn't know going to.
<?php $to = "addressone@unknown.com; addresstwo@unknown.com"; $subject = "subject"; $headers = "who it's from"; $forward = 1; $location = "thank address.html"; $date = date ("l, f js, y"); $time = date ("h:i a"); $msg = "below result of feedback form. submitted on $date @ $time.\n\n"; if ($_server['request_method'] == "post") { foreach ($_post $key => $value) { $msg .= ucfirst ($key) ." : ". $value . "\n"; } } else { foreach ($_get $key => $value) { $msg .= ucfirst ($key) ." : ". $value . "\n"; } } mail($to, $subject, $msg, $headers); if ($forward == 1) { header ("location:$location"); } else { echo "thank submitting our form. possible."; } ?> ok i've tried, , still doesn't seem working, know i'm missing somewhere. know when can if ever send bcc want send same subject other it's from.
$to = "email@email.com"; $subject = "subject1"; $headers = 'bcc: email2@email.com' . "\r\n"; $headers = 'from: complaint' . "\r\n"; $forward = 1; $location = "thank-you.html"; $date = date ("l, f js, y"); $time = date ("h:i a");
you need specify bcc part of additional headers mail service command. the documentation example:
$to = 'user1@example.com, user2@example.com'; // subject $subject = 'message subject'; // message $message = 'message body here'; // additional headers $headers = 'bcc: bcc_user1@example.com, bcc_user2@example.com' . "\r\n"; // mail service mail($to, $subject, $message, $headers); php
No comments:
Post a Comment