Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Sending Newsletter Emails Slow


brendanbell

Recommended Posts

Hi,

 

we are using the newsletter add-on to send out mass emailings to about 25K of contact records. Presently this takes about 10hrs to send. Which to me seems crazy.

 

When I kick off the job it sends what it looks like 1 email per second. Is there a way to change it from looping through each record one at a time to batch blasting these to the smtp server to manage?.

 

I say this because i means the machine we send the emails from is then not availabel until the job has completed.

 

Any help would be greatly appreciated

 

brendan

Link to comment
Share on other sites

Does your hosting service have some sort of email sending rate caps? E.g., 1 per second, or 20 per minute, or 300 per hour, etc.? Maybe your host is throttling your email sending to one per second? The first thing to do is to ask them. There's nothing inherent in osC which is shutting you down to 1 per second. It should take far less than 1 second for osC to generate each email, so I suspect that your process is "frozen" at the mail send, if you've sent an email within the last second.

Link to comment
Share on other sites

Are you sure you have sent out 25K emails? The newsletter manager, like Mr Phil says has nothing in it to slow it down. Typically what will happen is that the Newsletter manager will start firing off your mailing list until you spike your web host's bandwidth limit, at which point the Web host will blink you off for a microsecond. The newsletter manager will then stop and then display the message that it has completed, when it actually has only sent maybe a few hundred.

 

A program to throttle email would not be something you would expect to see installed automatically on a web host service.

Oscommerce site:

 

 

OSC to CSS, http://addons.oscommerce.com/info/7263 -Mail Manager, http://addons.oscommerce.com/info/8120

Link to comment
Share on other sites

Hi,

 

thanks for the replies. To answer your questions, we host the server in house. We have a T1 to the outside world. So there is no limit on from an ISP limiting the bandwidth.

 

Ive also checked the smtp server configuration and it can accept upto 25k of concurrent connections.

 

Looking at the code from the mailing_send.php file this is the section that i believe sends the emails. Now this to me is a simple loop, then fires off the emails.

 

My issue is it takes about 1 sec for each request to be sent. I would rather just be able to blast the requests to the smtp server and let it (the smtp server) manage the outbound mail. However at the moment it seems to send 1 email.. then... wait, then sednt the next.

 

			  
while ($users = tep_db_fetch_array($u_query)) {
			  if ($emails_sent==0) {
				  echo str_pad(strftime("%T") . " Sending flyers<br>" . "\n",1024);
				  flush();
			  }
			  $first_name=str_pad(rtrim($users['customers_firstname']),32);
			  $last_name=str_pad(rtrim($users['customers_lastname']),32);
			  $user_name=substr(str_pad(rtrim($users['customers_email_address']),32),0,32);
			  if (($first_name == $user_name) || ($last_name == $user_name)) $user_name = 'Customer';
			  else $user_name = rtrim($first_name) . " " . rtrim($last_name);
			  $mail->AddAddress($user_name . ' <' . $users['customers_email_address'] . '>');
			  if (!DEBUG) $mail->Send();
			  $mail->ClearAddresses();
			  $emails_sent++;
			  echo str_pad('.'."\n",1024);
			  if (($emails_sent % 100) == 0) echo str_pad('<br>'."\n",1024);
			  if (($emails_sent % 1000) == 0) echo str_pad(strftime("%T") . ' ' . $emails_sent . ' sent<br><br>' . "\n",1024);
			  flush();
			  if (!DEBUG) tep_db_query('insert into mailing_sent values(' . $mailing . ',' . $users['cid'] . ',now(),' . $log_id . ')');
		  }

 

Ive also looked at the script that is used the send the email (class.phpmailer.php) and although this has some configuration settings. There is nothing about accepting multiple connections.

 

So at the moment im completely stumped!

 

cheers

brendan

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...