title: Most efficient way to send mass emails in multi-tenant site?
body: <p>I have a multi-tenant site. Some of my clients send out 1 email here and there, others might send out 1,000 at one time.</p>
  
  <p>I'm using <a href="http://sendgrid.com" rel="nofollow">SendGrid.com</a> as my mail server and <a href="http://swiftmailer.org/" rel="nofollow">SwiftMailer.org</a> for my PHP code.</p>
  
  <p>The issue is each email takes a second or so to send. I guess it needs to connect to SendGrid.com to authenticate etc. So if you send 1,000 emails, it would in essence take about 1,000 seconds it times out. </p>
  
  <p>What I think is the best way is to store the emails in the database and then a cron job sends them out.</p>
  
  <p>Would that be te most effective way? And should I only send out a certain amount of emails at a time? So for example 100 per cron job?</p>
  
  <p>While I'm on the subject of cron jobs, can cron jobs over lap? So if I made it run the cron job every minute, and the page took 2 minutes to send all the emails, would the cron job run again after a minute or would it wait 2 minutes until the last cron job has processed?</p>
  
  <p>Thanks for your help!</p>
  
  <p>Ben</p>