Jump to content

[SOLVED] Bcc not working


Hooch

Recommended Posts

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.