chome4 Posted August 2, 2012 Share Posted August 2, 2012 Got a standard html email form with a checkbox for bcc: http://gibraltaraccountants.eu/test/feedback_form.html I'm using a php file from a website and it didn't originally have a 'bcc' section. I've been getting help to activate bcc but it came to nothing. What do I need to change in the php file so that, if checked, a bcc message is sent to the email address entered in 'Your Email Address' field in the form? 18762_.php Quote Link to comment https://forums.phpfreaks.com/topic/266584-bcc-in-email-form/ Share on other sites More sharing options...
jazzman1 Posted August 2, 2012 Share Posted August 2, 2012 Try, $header .= (!empty ($_POST['option1'])) ? "Bcc:$bcc_email\r\n" : null; Quote Link to comment https://forums.phpfreaks.com/topic/266584-bcc-in-email-form/#findComment-1366253 Share on other sites More sharing options...
chome4 Posted August 2, 2012 Author Share Posted August 2, 2012 Try, $header .= (!empty ($_POST['option1'])) ? "Bcc:$bcc_email\r\n" : null; I assume that code had to go near the bottom at line 51. I got an email in the webmaster address but still no bcc for the email address entered. Quote Link to comment https://forums.phpfreaks.com/topic/266584-bcc-in-email-form/#findComment-1366303 Share on other sites More sharing options...
jazzman1 Posted August 2, 2012 Share Posted August 2, 2012 You need a different script to use BCC. Take a look at here: http://forums.phpfreaks.com/index.php?action=profile;u=128305;area=showposts;start=135 http://forums.phpfreaks.com/index.php?topic=362994.msg1718064#msg1718064 Quote Link to comment https://forums.phpfreaks.com/topic/266584-bcc-in-email-form/#findComment-1366351 Share on other sites More sharing options...
Christian F. Posted August 6, 2012 Share Posted August 6, 2012 Looking at the code you've attached to your OP, you need to add \r\n to the header after the original e-mail address as well. Right now the completed header will look like this: From: bot@invalid.comBCC:my_mail@invalid.com Quote Link to comment https://forums.phpfreaks.com/topic/266584-bcc-in-email-form/#findComment-1367102 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.