1

I am trying to send bulk email using swift mailer I have to send 2500 emails at a time, unfortunately i cant sent more than 30 emails I use the following code

$sql = $db->Query("SELECT * FROM customer_data WHERE c_status=?", array("0"));
while($row=$db->FetchRow($sql)){

  $body="Test body";
  // Create a message
    $message = (new Swift_Message('test subject'))
      ->setFrom(['no_reply@xxx.com' => 'xxxx Group'])
      ->setTo([$row['c_email']])
      ->setBody($body, 'text/html')
      ;
    // Send the message
    $result = $mailer->send($message);

} 

After 30 Emails i got an error like

Fatal error: Uncaught Swift_TransportException: Expected response code 250 but got an empty response in C:..\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\AbstractSmtpTransport.php:445 Stack trace: #0 C:..\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\AbstractSmtpTransport.php(341): Swift_Transport_AbstractSmtpTransport->assertResponseCode('', Array) 1 C:..\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\EsmtpTransport.php(305): Swift_Transport_AbstractSmtpTransport->executeCommand('MAIL FROM:executeCommand('DATA\r\n', Array, Array) #3 C:..\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\AbstractSmtpTransport.php(497): Swift_Transport_A in C:..\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\AbstractSmtpTransport.php on line 445

any suggestions will be really appreciated.

0 Answers0