Hooch Posted October 18, 2008 Share Posted October 18, 2008 Hello all, I have googled this to death and all the answers still do not send to Bcc. Here's my code <?php if(!$_POST['submit']) { ?> <form method="post" action="send_email.php" id="mailit" name="mailit"> <b>Subject:</b><br /> <input name="txtSubject" type="text" class="txtbox" title="" size="70" maxlength="70"/> <br /> <b>Message:</b><br /> <textarea name="txtMessage" cols="50" rows="10" wrap="VIRTUAL" class="txtbox" /></textarea> <br /> <input name="Reset" type="reset" value="Clear"/> <input name="submit" type="submit" value="Send"/> </form> <?php } else { //Set up info $to = "someone@thiersite.com"; $subject = stripslashes($_POST['txtSubject']); $message = stripslashes($_POST['txtMessage']); $headers = "From:Me<me@mysite.org>\r\n"; $headers .= "Reply-To:Do not reply\r\n"; $headers .= "cc: \r\n"; $headers .= "Bcc:someoneelse@theirsite.net;\r\n" . "X-Mailer: PHP 4.x"; if ( mail($to,$subject,$message,$headers) ) { echo "The email has been sent!"; } else { echo "The email has failed!"; } } This code will print the error "The email has failed!", but the email does get sent to the 1st recipient. The Bcc: is causing the error to show, even though the email gets through. The Bcc: person does not get the email. Thanks for your time Quote Link to comment 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.