Hi,

I'm trying to write a simple script that I can use to send email to my mailing list. I've created a form and I'm wanting to send all of the emails using bcc.
So basically, I just wanna paste all of the names into the bcc field of my form.

It works fine if I only put in one address into the bcc field but if I try to do this: someone@somewhere.com, someone2@somewhere.com
It just doesn't send the email to any addresses that appear in my bcc field.

Here's my code, I'm only new to this, so be kind 😉 :

<?

if ($goto_send == "send") send_program();
else initial_form();

function initial_form() {

global $to, $bcc, $cc, $message;

echo

"<form method=\"post\">
<table width=\"500\" height=\"30\">
<tr height=\"5\">
<td><div a<b>To:</b><br><input type=\"text\" name=\"to\" size=\"25\"></td></tr>
<tr height=\"5\">
<td><b>Bcc:</b><br><input type=\"text\" name=\"bcc\" size=\"25\"></td></tr> 
<tr height=\"5\">
<td><b>Cc:</b><br><input type=\"text\" name=\"cc\" size=\"25\"></td></tr> 
<tr height=\"5\">
<td><b>Message:</b><br><textarea wrap= \"on\" name=\"message\" cols=\"100\" rows=\"20\"></textarea></td></tr>
<tr height=\"5\">
<td><input type=\"submit\" name=\"submit\" value=\"SEND LETTER\"></td></tr>
<input type=\"hidden\" name=\"goto_send\" value=\"send\">
</table>

</form>";

}

function send_program() {

global $to, $bcc, $cc, $message;

$message = stripslashes($message);
$subject="This is my letter";
$from="ME";

$success = mail($to,$subject,$message,"From: \"$from\"<someone@somewhere.com>\nBcc:<$bcc>");

if ($success)
echo "Message sent";
else
echo "Message failed to send";
}
?>

    Excellent!!

    That's all it was, thanks heaps.

      Write a Reply...