reflex84 Posted October 1, 2008 Share Posted October 1, 2008 Alright,Heres an easy one for you guys!I have a php form for my website and I would like to know how to set up the php form so thatwhen someone submits the form the submissions goes to both myself and another email address WITHOUT the other person knowing thatI will receive a copy too. $to = "example@something.com"; $from = $_POST['email']; $subject = "Website Enquiry"; Now with the code above, I think I tried to do this: $to = "example@something.com; anotheraddress@something.com"; $from = $_POST['email']; $subject = "Website Enquiry"; ... and it didn't work!Now this should be easy!I appreciate your help - thanks!Dale. Link to comment Share on other sites More sharing options...
justsomeguy Posted October 1, 2008 Share Posted October 1, 2008 That should work, try removing the space. If you don't want the one recipient to know that you got it though, then you'll either need to send 2 mails or use the BCC header to include yourself. The other recipient won't see the BCC header. Link to comment Share on other sites More sharing options...
reflex84 Posted October 1, 2008 Author Share Posted October 1, 2008 That should work, try removing the space. If you don't want the one recipient to know that you got it though, then you'll either need to send 2 mails or use the BCC header to include yourself. The other recipient won't see the BCC header.Hey,Thanks you are always on the ball!ok so you reckon I should do this then:$to = "example@something.com"; $bcc = "example@something.com"; $from = $_POST['email']; $subject = "Website Enquiry"; Did I get the BCC part correct?d Link to comment Share on other sites More sharing options...
justsomeguy Posted October 1, 2008 Share Posted October 1, 2008 Right, but the BCC is only one header (like from). You send all the headers at once and separate them with \r\n. $to = "example@something.com"; $bcc = "example@something.com"; $from = $_POST['email']; $subject = "Website Enquiry"; $headers = "From:{$from}\r\nBCC:{$bcc}\r\n"; mail ($to, $subject, $body, $headers); Link to comment Share on other sites More sharing options...
reflex84 Posted October 1, 2008 Author Share Posted October 1, 2008 You are a legend dude!Thanks - I have just tested out the form and it works 100%Many Thanks from South AfricaDale. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.