如下:
// Set this values:
$strHost ="localhost";
$strUser ="root";
$strPassw ="";
$strSender="you@domain.com"; if (!$btnSendEmail)
{
?>
The email will be added automatically with "Hello Name" in the first line of
the emailbody!
}
if (isset($btnSendEmail))
{ echo "Send Email
";
// Create connection
$intConID = mysql_pconnect($strHost,$strUser,$strPassw);
// Header
$strHeader = "Return-Path: $strSendernErrors-To: $strSendernFrom:
$strSender";
// SQL
$strSQL = "select name,email from email_notify where lcase(what) =
'$strWhat'";
$intRes = mysql_query($strSQL,$intConID);
echo "Send Email $strBody
";
// fetch array
while($saRow = mysql_fetch_array($intRes))
{ $strEmail = $saRow["email"];
$strName = $saRow["name"];
$strBodyComplete = "Hello " . $strName[$i] . "!nn" . $strBody;
// Email
mail($strEmail,$strSubject,$strBodyComplete,$strHeader);
// Output
echo "Send to $strName
";
}
}
?>



