email - Unable to send mail to more than 200 member at at a time using php mail function -
hello guy using php mail function deliver mails if run code locally 5 email id working fine without error if run same code more 400 email id show warning messages link
warning: mail() [function.mail]: not execute mail delivery program '/usr/sbin/sendmail -t -i' in /home/sendinvite.php on line 147 i using code :
$sqlquery1 = "select employee empl sstatus != 'c'"; $sqlmath1 = mysql_query($sqlquery1) or die("error: (" . mysql_errno() . ") " . mysql_error()); $cnt = mysql_num_rows($sqlmath1); if($cnt !="0") { while($query1 = mysql_fetch_array($sqlmath1)) { $email1=$query1['employee']; $emid1=base64_encode($email1); $sid1 =base64_encode($sidtest); $email_from1 = "admin@gmail.com"; $link1="http://www.xx.php?mid=$emid1&sid=$sid1"; //send mail $emailto_web1 = $email1; $email_headers1 = "from: ".$email_from1; num_sent_web1 = 0; $email_message21 = "dear employee, \n"; $email_message21 .= "\n"; $email_message21 .= "if cannot click on url, copy url , paste on address bar.\n"; $email_message21 .= "\n"; $email_message21 .= $link1."\n"; $email_message21 .= "\n\n\n"; $email_message21 .= "regards,\n"; $email_message21 .= "admin team. \n"; $mail_web1 = mail($emailto_web1,$email_subject1,$email_message21,$email_headers1); if($mail_web1) { $err = "remainder send successfully"; } else { $err=$email." try again"; } } } // not equal 0 condition i dont know exact reason why receive warning message, please post valuble suggestion. in advance !!!
use cron job , send mails in chunks instead of sending mails in 1 time.
Comments
Post a Comment