Jump to content

Slow SwiftMailer


cartaysm

Recommended Posts

I have swift mailer setup to send two message and plain and HTML. I have followed a lot of different posts and came up with a solution that works. However when I send for example 7k emails only about 500 made it out before the 30sec timeout. So I switched my timeout to 600secs and only about 3k made it out.

 

I now I can switch my timeout to 0 or 3600sec and it will go through but it doesnt seem like this should take so long.

 

I use Debian 6.0, Zimbra 7, Postfix, and SwiftMailer

 

I am using the mailer like this;

 

/ Create the Transport

$transport = Swift_SmtpTransport::newInstance('localhost', xx)

->setUsername('xxx')

->setPassword('xxx')

;

 

// Create the Mailer using your created Transport

$mailer = Swift_Mailer::newInstance($transport);

 

//Starts the loop to separate the to email addresses everything past here is built for each email

$to1 = explode(", ", $to);

for($i = 0; $i < count($to1); $i++){

 

// Create a message

$message = Swift_Message::newInstance($subject)

->setFrom(array($from => 'xxx'))

->setTo(array($to1[$i]))

->setBody($plaintxt)

->addPart($htmltxt, 'text/html');

 

$plaintxt = substr($plaintxt, 0, -$plaindumplength);

$htmltxt = substr($htmltxt, 0, -$dumplength);

 

$emailcounter += $mailer->send($message);

}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.