mail.php - add send to cc:

  • Thread starter Thread starter Anonymous
  • Start date Start date
A

Anonymous

Guest
I need to add a cc: $email to the send email and don't know how to accomplish this. My mail.php follows:

Code:
<?php
$subject = $_POST['type'];
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent=" From: $name  \n Subject: $subject  \n Message: $message";
if ($subject =="Website Problem") {
        $recipient="webmaster@foxclone.com" ;
      }
else{
        $recipient="andyh@foxclone.com";
      }
$mailheader = "From: $email \r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank You!" . " -" . "<a href='index3.php' style='text-decoration:none;color:#ff0099;'> Return Home</a>";
?>

Thanks in advance,
Larry
 
Got it working doing it this way:

Code:
<?php
$subject = $_POST['type'];
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$formcontent="From: $name\r\nEmail: $email\r\nMessage: $message";
if ($subject =="Website Problem") {
        $recipient="webmaster@foxclone.com" ;
      }
else{
        $recipient="help@foxclone.com";
      }
$mailheader = "From: $email\r\nBcc: $email\r\n";
mail($recipient, $subject, $formcontent, $mailheader) or die("Error!");
echo "Thank you for contacting us!" . " -" . "<a href='index3.php#contact' style='text-decoration:none;color:#ff0099;'> Return Home</a>";
?>
 
Back
Top