Answers.Body: <p>I think at some point we did do that. However, we also noticed that some smtp mailers are not very good at reporting back errors and jobs would hang / not deliver email. We put in some code to get around that and periodically check for the connection to be alive and valid</p>
  
  <p>We do check the 'persist' flag in the mailer library.Check</p>
  
  <p>CRM_Core_Config::getMailer</p>
  
  <p>for more details</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-04T16:43:33.490Z
Answers.Text: Ah ok, was looking at the wrong library (ezc instead of pear). Still something weird, I will need to setup a fake smtp server to log what's happening for real.
Answers.UserDisplayName: Xavier
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-04T16:00:54.737Z
Answers.LastActivityDate: 2015-05-04T16:00:54.737Z
Answers.UserDisplayName: Donald Lobo
Body: <p>I'm trying to be able to send as much emails as possible. Beside doing more stuff in parallel (eg run several cronjobs in parallel on separate batch of contacts), I'm trying to find a way to improve civimail</p>
  
  <p>One easy win seems to use the smtp delivery mechanism and keep the smtp connection open for the duration of the batch. The library we use offers this option with <a href="http://ezcomponents.org/docs/api/trunk/Mail/ezcMailSmtpTransport.html" rel="nofollow">keepConnection=true</a> but I don't see it used in civimail</p>
  
  <p>Am I missing something? Is this a path that has been explored?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-05-04T13:15:59.023Z
Comments.Text: Could you say more about your current environment?  Are you running your own MTA or using a third party?  Which MTA/third party?
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-05-04T13:16:52.757Z
Comments.Text: RIght now, my own MTA (postfix) but planning to move to mailjet soon (decent prices, and not US based)
Comments.UserDisplayName: Xavier
Tags: <civimail>
Title: Improve the speed of civimail
ThreadText: # Improve the speed of civimail
  
  (Asked by: username_0 on 2015-05-04)
  
  I'm trying to be able to send as much emails as possible. Beside doing more stuff in parallel (eg run several cronjobs in parallel on separate batch of contacts), I'm trying to find a way to improve civimail
  
  One easy win seems to use the smtp delivery mechanism and keep the smtp connection open for the duration of the batch. The library we use offers this option with [keepConnection=true](http://ezcomponents.org/docs/api/trunk/Mail/ezcMailSmtpTransport.html) but I don't see it used in civimail
  
  Am I missing something? Is this a path that has been explored?
  
  **Tags:** civimail
  
  > **Comments:**
  > **username_1**: Could you say more about your current environment?  Are you running your own MTA or using a third party?  Which MTA/third party?  
  > **username_0**: RIght now, my own MTA (postfix) but planning to move to mailjet soon (decent prices, and not US based)  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2015-05-04. Score: 3 | Accepted answer
  
  I think at some point we did do that. However, we also noticed that some smtp mailers are not very good at reporting back errors and jobs would hang / not deliver email. We put in some code to get around that and periodically check for the connection to be alive and valid
  
  We do check the 'persist' flag in the mailer library.Check
  
  CRM\_Core\_Config::getMailer
  
  for more details
  
  > **Comments:**
  > **username_0**: Ah ok, was looking at the wrong library (ezc instead of pear). Still something weird, I will need to setup a fake smtp server to log what's happening for real.  
  
  ---
  
  