| rilkesf 2005-09-14, 4:20 am |
| Look at the first link. You'll notice how it says that the mail() function
takes this form:
mail($to, $subject, $message, $headers);
The headers variable is where you can add any extra things you want (generally
things like CC, BCC, From, etc.)
In your case, you'll want to include CC and enter your own address (use the
$to variable for the user's email address). You can add additional options to
the $headers variable by appending to the variable with the construct ".="
So, in your instance, your code will look something like this:
<?php
$to= $_POST['email']; /* user's email from previous page's form (POST assumes
the form method was 'post' */
$message = '<h1>Thanks for registering</h1> ...'; // HTML or Plain text
message
$subject = 'Your email subject here'; // enter the email subject
$headers = 'CC: your@email.com'; // enter the CC header to email yourself
$headers .= ''MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// then just call the mail() function
mail($to, $subject, $message, $headers);
?>
Hope that helps
|