Jump to content

Submitting forms to more than 1 person


reflex84

Recommended Posts

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

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...