I-AM-OBODO Posted August 7, 2008 Share Posted August 7, 2008 How can i add bcc to my script and form. the script and form below is working perfectly. if i include more than one email, it shows all the people the same message was sent to. so the question, i dont know how to add the bcc to my html form so it could work with my script. help needed pls thanx This is my script <?php $name=$_POST['name']; $email=$_POST['email']; $to=$_POST['to']; $subject=$_POST['subject']; $message=$_POST['message']; if(mail($to, $subject, $message,"From: $email\n")) { echo "Message Sent"; } else { echo "There was a proble so message was not sent"; } ?> here is my form: <form id="form1" name="form1" method="post" action=""> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td>Your name </td> <td><input name="name" type="text" id="name" /></td> </tr> <tr> <td>Your Email </td> <td><input name="email" type="text" id="email" /></td> </tr> <tr> <td>Recipient Email </td> <td><input name="to" type="text" id="to" /></td> </tr> <tr> <td>Bcc </td> <td><input name="bcc" type="text" id="bcc" /></td> </tr> <tr> <td>Subject </td> <td><input name="subject" type="text" id="subject" /></td> </tr> <tr> <td width="25%" height="64" valign="top">Message</td> <td width="75%" valign="top"><textarea name="message" cols="50" rows="15" id="message"></textarea></td> </tr> <tr> <td> </td> <td><input name="send" type="submit" id="send" value="Send" /></td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2"> </td> </tr> </table> </form> Link to comment https://forums.phpfreaks.com/topic/118537-help-on-email-bcc/ Share on other sites More sharing options...
mpar612 Posted August 7, 2008 Share Posted August 7, 2008 You can add a header. $headers = "Bcc: [email protected]"; You will also need to modify your mail() to: mail($to, $subject, $message, $headers); That should do it for you. Link to comment https://forums.phpfreaks.com/topic/118537-help-on-email-bcc/#findComment-610304 Share on other sites More sharing options...
I-AM-OBODO Posted August 7, 2008 Author Share Posted August 7, 2008 how di make the bcc reflect on the html form. that is the issue thanks Link to comment https://forums.phpfreaks.com/topic/118537-help-on-email-bcc/#findComment-610320 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.