What im attempting to do is pull email address from a database already built, i need to be able to select the email address depending on the date they are given.
Then i need to be able to Implode the list of email address so i can send out multiple emails to multiple Clients at one time. This is what i have so far.
*************** ***Form Application**** ************
<select name="emailto" size="15" multiple id="emailto" style="color: #000000; font-size: 8pt; font-family: Verdana" tabindex="">
<?php
$users_sql = "SELECT * FROM ******* WHERE site_tag = '*****' AND date_received BETWEEN '" . $_POST["startDate"] . "' AND '" . $_POST["endDate"] . "'";
$users_result = @mysql_query($u sers_sql);
while($users = @mysql_fetch_ar ray($users_resu lt))
{
echo "<option";
echo">" . $users["email"] ;
echo",</option>\n";
}
?>
</select>
*************** ***********
*************** ***********php code*********** **********
if($_POST['email_now'])
{
$to = $_POST['emailto'];
$from = "************** *";
$subject = "************** *****";
$headers .= ''************* **".$eol;
$headers .= '************** '.$eol;
$headers .= 'Return-Path: '.$eol; // these two to set reply address
$headers .= "Message-ID: <".$subject.">" .$eol;
//$headers .= "Message-ID: <".$now." TheSystem@".$_S ERVER['SERVER_NAME'].">".$eol;
$headers .= "X-Mailer: PHP v".phpversion() .$eol; // These two to help avoid spam-filters
# Boundry for marking the split & Multitype Headers
$mime_boundary= md5(time());
$headers .= 'MIME-Version: 1.0'.$eol;
$headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;
$body= $_POST['edited'];
//EOF;
$success = mail($to, $subject, $body, $headers);
if ($success)
{
$msg="";
mass_email($msg );
}
else
{
$msg=".";
mass_email($msg );
}
}
But what i need it to do is when i select or whoever i select from that form and click Email, it emails all of them. and i cant figure out for the life of me what im doing wrong.
Then i need to be able to Implode the list of email address so i can send out multiple emails to multiple Clients at one time. This is what i have so far.
*************** ***Form Application**** ************
<select name="emailto" size="15" multiple id="emailto" style="color: #000000; font-size: 8pt; font-family: Verdana" tabindex="">
<?php
$users_sql = "SELECT * FROM ******* WHERE site_tag = '*****' AND date_received BETWEEN '" . $_POST["startDate"] . "' AND '" . $_POST["endDate"] . "'";
$users_result = @mysql_query($u sers_sql);
while($users = @mysql_fetch_ar ray($users_resu lt))
{
echo "<option";
echo">" . $users["email"] ;
echo",</option>\n";
}
?>
</select>
*************** ***********
*************** ***********php code*********** **********
if($_POST['email_now'])
{
$to = $_POST['emailto'];
$from = "************** *";
$subject = "************** *****";
$headers .= ''************* **".$eol;
$headers .= '************** '.$eol;
$headers .= 'Return-Path: '.$eol; // these two to set reply address
$headers .= "Message-ID: <".$subject.">" .$eol;
//$headers .= "Message-ID: <".$now." TheSystem@".$_S ERVER['SERVER_NAME'].">".$eol;
$headers .= "X-Mailer: PHP v".phpversion() .$eol; // These two to help avoid spam-filters
# Boundry for marking the split & Multitype Headers
$mime_boundary= md5(time());
$headers .= 'MIME-Version: 1.0'.$eol;
$headers .= 'Content-Type: text/html; charset=iso-8859-1'.$eol;
$body= $_POST['edited'];
//EOF;
$success = mail($to, $subject, $body, $headers);
if ($success)
{
$msg="";
mass_email($msg );
}
else
{
$msg=".";
mass_email($msg );
}
}
But what i need it to do is when i select or whoever i select from that form and click Email, it emails all of them. and i cant figure out for the life of me what im doing wrong.
Comment