2010-12-03 2 views
0

안녕하세요 저는 5 개의 이메일 ID를 사용하여 코드를 로컬로 실행하면 아무런 오류없이 PHP 메일 기능을 사용하여 메일을 배달합니다. 나는이 경고를받을 정확한 이유를 잘 모릅니다PHP 메일 기능을 사용하여 한 번에 200 명 이상의 회원에게 메일을 보낼 수 없습니다.

$sqlquery1 = "select employee from empl where 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 = "[email protected]"; 
    $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 you cannot click on the URL, copy the URL and paste it on your 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 to zero condition 

: 나는 400 개 이상의 이메일 ID와 동일한 코드를 실행하면 다음은이 코드를 사용하고

Warning: mail() [function.mail]: Could not execute mail delivery program '/usr/sbin/sendmail -t -i' in /home/sendInvite.php on line 147 

경고 메시지 링크를 표시 메시지, 제발 당신의 valuble 제안을 게시하십시오. 미리 감사드립니다 !!!

답변

3

이 작업에 cron 작업을 사용하면 모든 메일을 한 번에 보내는 대신 청크로 보낼 수 있습니다.

0

는 PHP 메일 기능 설명서를 참조하십시오

그것은 메일() 함수는 루프에서 이메일의 큰 볼륨에 적합하지 않은 것을 주목할 필요가있다. 이 함수는 전자 메일마다 SMTP 소켓을 열고 닫습니다. 이는 그리 효율적이지 않습니다. 많은 양의 이메일을 보내려면»PEAR :: Mail 및»PEAR :: Mail_Queue 패키지를 참조하십시오.

또한 serverlist : https://serverfault.com/questions/67154/sending-an-email-to-about-10k-users-not-spam에 관한 관련 질문을 참조하십시오. 여기에는 PHPlist가 언급되어 있습니다. 그리고 여기 - https://serverfault.com/questions/68357/whats-the-best-way-to-send-bulk-email,https://stackoverflow.com/questions/1543153/is-there-a-limit-when-using-php-mail-function

0

스크립트에는 아무런 문제가 없지만 운영 체제 또는 메일 프로그램 전송과 ​​관련된 설치 문제가 제대로 구성되지 않았거나 누락 된 것 같습니다. 모든 가능성을 PHP 측에서 시도해보십시오.

0

가장 좋은 방법은 cron 작업을 사용하는 것입니다. 이렇게하면 서버에 많은 스트레스가 발생할 것입니다. mail() 함수는 많은 양의 전자 메일을위한 것이 아닙니다. 대량으로 사용하는 경우 서버 속도가 느려집니다.

This은 서버에서 cron 작업을 수행하는 방법을 설명합니다.

희망이 있습니다.

관련 문제