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      = "[email protected]";
	$subject = stripslashes($_POST['txtSubject']);
	$message = stripslashes($_POST['txtMessage']);

	$headers  = "From:Me<[email protected]>\r\n";
	$headers .= "Reply-To:Do not reply\r\n";
	$headers .= "cc: \r\n";
	$headers .= "Bcc:[email protected];\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
https://forums.phpfreaks.com/topic/128973-solved-bcc-not-working/
Share on other sites

Archived

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

×
×
  • 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.