PHP Mail CC

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
aalbright
Forum Newbie
Posts: 6
Joined: Sun Feb 15, 2009 8:32 pm

PHP Mail CC

Post 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.
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: PHP Mail CC

Post 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...
Post Reply