TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 02-03-2012, 03:56 PM   #1 (permalink)
The Visitor
 
Join Date: Feb 2012
Posts: 1
Thanks: 0
cartaysm is on a distinguished road
Default Slow SwiftMailer

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);
}
cartaysm is offline  
Reply With Quote
Old 02-18-2012, 09:37 PM   #2 (permalink)
The Wanderer
 
AxelG's Avatar
 
Join Date: Feb 2012
Posts: 16
Thanks: 0
AxelG is on a distinguished road
Default

One solution is to use a javascript.
1- You send 50 emails
2- you send the info to your script that you have sent 50 emails
3- your script does the request for the 50 other
By this way you avoid the maximum execution time
AxelG is offline  
Reply With Quote
Old 08-31-2012, 01:50 AM   #3 (permalink)
The Visitor
 
Join Date: Aug 2012
Posts: 2
Thanks: 0
souvenir is on a distinguished road
Default

I can guarantee you a Custom T-Shirts CMS is a bad idea, it is a sure failure because it is so big and could take as long as a year (yes, a year) to complete. I went through Custom Short Sleeve T-Shirts before.
souvenir is offline  
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Cron Running Slow Schroder General 1 11-27-2010 11:34 PM
slow nefus The Lounge 4 03-21-2009 01:48 AM
GMail extremely slow.. eventually crashes Orc The Lounge 3 02-11-2009 04:07 PM


All times are GMT. The time now is 02:45 PM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design