Help Email Bcc
Posted: Wed Aug 06, 2008 8:05 pm
How can i add bcc to my script and form. the script and form below is working perfectly. if i include more than one email, it shows all the people the same message was sent to. so the question, i dont know how to add the bcc to my html form so it could work with my script. help needed pls
thanx
This is my script
thanx
This is my script
Code: Select all
<?php
$name=$_POST['name'];
$email=$_POST['email'];
$to=$_POST['to'];
$subject=$_POST['subject'];
$message=$_POST['message'];
if(mail($to, $subject, $message,"From: $email\n"))
{
echo "Message Sent";
} else {
echo "There was a proble so message was not sent";
}
?>
here is my form:
<form id="form1" name="form1" method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Your name </td>
<td><input name="name" type="text" id="name" /></td>
</tr>
<tr>
<td>Your Email </td>
<td><input name="email" type="text" id="email" /></td>
</tr>
<tr>
<td>Recipient Email </td>
<td><input name="to" type="text" id="to" /></td>
</tr>
<tr>
<td>Bcc </td>
<td><input name="bcc" type="text" id="bcc" /></td>
</tr>
<tr>
<td>Subject </td>
<td><input name="subject" type="text" id="subject" /></td>
</tr>
<tr>
<td width="25%" height="64" valign="top">Message</td>
<td width="75%" valign="top"><textarea name="message" cols="50" rows="15" id="message"></textarea></td>
</tr>
<tr>
<td> </td>
<td><input name="send" type="submit" id="send" value="Send" /></td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
<tr>
<td colspan="2"> </td>
</tr>
</table>
</form>