August 25, 2012

How to send Multiple Emails in PHP


include("../connect.php");
if(isset($_REQUEST['Send']))
{
foreach ($_POST['chk_box'] as $id)
{
      $qr = mysql_query("SELECT email FROM <Table Name> WHERE id = '".$id."' ");
      if (mysql_affected_rows()>0)
{
while ($email = mysql_fetch_array($qr))
{
            $email_add = $email['email'];
 mail( $email_add , 'Subject','Message Goes Here', "From: <Your Email Address>");
}
}
}
}

No comments:

Post a Comment

Integrating Google reCAPTCHA v3 in HTML Form with PHP

  What is Google reCAPTCHA v3? Google reCAPTCHA is a free service that helps protect websites from spam and abuse. reCAPTCHA v3 is the lates...