GrizzlyBear Posted October 28, 2008 Share Posted October 28, 2008 Hi could anyone perhaps help me out with being able to bcc someone from a form on a website. I can send to multiple address' but not sure how to send to one email, and bcc two others. Thanks. <?php $to = '[email protected] , [email protected]'; $email = $_POST['Email']; $name = $_POST['Name']; $telephone = $_POST['PhoneNumber']; $surname = $_POST['Surname']; $golfclub = $_POST['GolfClub']; $attending = $_POST['Radio1']; $day = $_POST['Radio2']; $number = $_POST['Number']; $message = <<<MESSAGE <html> <head> <title>Launch RSVP Form</title> </head> <body> <table style="font: Tahoma, Verdana, Arial, Helvetica, sans-serif" style="font-size:12px" border="0" cellspacing="3" align="center"> <tr> <td align="center" bgcolor="#91a93e" colspan="2"><strong>LAUNCH RSVP FORM</strong></td> </tr> <tr> <td bgcolor="#FFFFFF" colspan="2"></td> </tr> <tr> <td bgcolor="#91a93e" width="150">Name</td> <td bgcolor="#ADCE39" width="300">$name</td> </tr> <tr> <td bgcolor="#91a93e" width="150">Surname</td> <td bgcolor="#ADCE39" width="300">$surname</td> </tr> <tr> <td bgcolor="#91a93e" width="150">Telephone</td> <td bgcolor="#ADCE39" width="300">$telephone</td> </tr> <tr> <td bgcolor="#91a93e" width="150">Home Golf Club</td> <td bgcolor="#ADCE39" width="300">$golfclub</td> </tr> <tr> <td bgcolor="#91a93e" width="150">Attending</td> <td bgcolor="#ADCE39" width="300">$attending</td> </tr> <tr> <td bgcolor="#91a93e" width="150">Day Attending</td> <td bgcolor="#ADCE39" width="300">$day</td> </tr> <tr> <td bgcolor="#91a93e" width="150">Number Attending</td> <td bgcolor="#ADCE39" width="300">$number</td> </tr> </table> </body> </html> MESSAGE; $subject = 'The Bay Launch RSVP'; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: ' . $email; mail($to, $subject, $message, $headers); header('Location: http://www.thebaygolf.co.za/'); ?> Link to comment https://forums.phpfreaks.com/topic/130397-solved-bcc/ Share on other sites More sharing options...
bobbinsbro Posted October 28, 2008 Share Posted October 28, 2008 on the php website, i found that you can either use additional headers like this: $headers .= 'Cc: [email protected]' . "\r\n"; $headers .= 'Bcc: [email protected]' . "\r\n"; or just use the imap_mail() function, which has cc and bcc options built in. Link to comment https://forums.phpfreaks.com/topic/130397-solved-bcc/#findComment-676388 Share on other sites More sharing options...
GrizzlyBear Posted October 28, 2008 Author Share Posted October 28, 2008 Thanks for your help hey..Perfect! Link to comment https://forums.phpfreaks.com/topic/130397-solved-bcc/#findComment-676393 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.