Page 1 of 1

PHP Mail CC

Posted: Tue Mar 10, 2009 8:35 pm
by aalbright

Code: Select all

  1. <?php
   2. $to = "you@yoursite.com";
   3. $subject = "Contact Us";
   4. $email = $_REQUEST['email'] ;
   5. $message = $_REQUEST['message'] ;
   6. $headers = "From: $email";
   7. $sent = mail($to, $subject, $message, $headers) ;
   8. if($sent)
   9. {print "Your mail was sent successfully"; }
  10. else
  11. {print "We encountered an error sending your mail"; }
  12. ?>
Is it possible to add a CC address to this code? Thank you for your help.

Re: PHP Mail CC

Posted: Tue Mar 10, 2009 11:24 pm
by requinix

Code: Select all

$headers = "From: $email";
Looks like the right place. I wonder if the manual page has anything to say about it...