我试图一次发送20封电子邮件但是当我运行我的php文件时它只发送了20封电子邮件中的2封。我一直试图重新加载我的php页面,它一次只能发送2个。那么,我能为下面的代码做些什么呢?
<?
require_once "lib/base.inc.php";
$arrResult = $oAdminEmail->getQueEmail();
for($i=0; $i<count($arrResult); $i++)
{
$iId = $arrResult[$i]['id'];
$email = $arrResult[$i]['contact_email'];
$name = $arrResult[$i]['contact_first']." ".$arrResult[$i]['contact_last'];
$message = "test";
$subject = "test";
$sendFlag = $eMailer->sendEDM($email,$name,$subject,$message);
if ($sendFlag)
{
$update['status'] = 1;
$update_edm = $oAdminEmail->updateEmailStatus($update,$iId);
}
}
?>
function getQueEmail()
{
global $db;
$arrResult = array();
$stmt = "SELECT * FROM "._CONST_TBL_EMAIL_OUTGOING." WHERE status = '0' ORDER BY id ASC LIMIT 20";
if($rs = $db->Execute($stmt))
{
$arrResult = $rs->GetArray();
}
return $arrResult;
}