Getting a CC copy of user invite Emails
<p>The code below works great.  It allows a user to send a recommendation for my site to a list of friends via email.  </p>

<p>For each person that gets the email below, I would like to get an email with that person's email, and the name of the person that sent them the message.  If my email address was john@site.com, what code could I use to do this?</p>

<p>Thanks in advance,</p>

<p>John</p>

<pre><code>$msg = "&lt;html&gt;&lt;body&gt;Hello, your friend ".htmlspecialchars($_POST['sendername'])." recommends that you use &lt;a href='http://www.site.com/'&gt;Site.com&lt;/a&gt;.&lt;a href='http://www.site.com/'&gt;Site.com&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;img src='http://site.com/images/blacklogo.PNG'&gt;&lt;/body&gt;&lt;/html&gt;";
$subject = "Try out Site.com";
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= 'From: ' . $_POST['sendername'] . "\r\n";
foreach($_POST['email'] as $email){
mail($email, $subject,$msg,$headers);
}
</code></pre>
