Answers.Body: <p>Yes its possible to set Outbound email to 'Redirect to Database' by simply adding 2 lines in your civicrm.settings.php</p>
  
  <pre><code>global $civicrm_setting;
  $civicrm_setting['Mailing Preferences']['mailing_backend']['outBound_option'] = 5;
  </code></pre>
  
  <p><strong>Note:</strong> If <code>global $civicrm_setting;</code> is already present then no need to add it.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-29T14:49:37.150Z
Answers.Text: Richard, Did the setting work?
Answers.UserDisplayName: Pradeep Nayak
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-29T13:51:08.823Z
Answers.LastActivityDate: 2017-12-29T13:51:08.823Z
Answers.UserDisplayName: Pradeep Nayak
Answers.Body: <p>$civicrm_setting['Mailing Preferences']['mailing_backend']['outBound_option'] = 5;</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-30T13:07:16.153Z
Answers.Text: Thanks for your answer.  It would be helpful to others if you could edit it to provide a bit more detail.
Answers.UserDisplayName: William Mortada
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-12-29T15:15:45.287Z
Answers.LastActivityDate: 2017-12-29T15:15:45.287Z
Answers.UserDisplayName: FullStack-Dev
Body: <p>ola, i just stumbled upon the <a href="https://github.com/ixiam/com.ixiam.modules.mailreader" rel="noreferrer">https://github.com/ixiam/com.ixiam.modules.mailreader</a> extension and would love to use it on our dev/stage environment. </p>
  
  <p>It enables a ui to read email that were redirected to the database. now my question is: is it possible to enable DB email redirect with a line of code in civicrm.settings.php?</p>
  
  <p>When copying production databases to dev &amp; stage it would be great to be able to override the mail setting to redirect to the database. </p>
  
  <p>So far I only found 
  define('CIVICRM_MAIL_LOG', 1); and 
  define('CIVICRM_MAIL_LOG', '/dev/null');
  as available settings in <a href="https://docs.civicrm.org/dev/en/latest/tools/debugging/" rel="noreferrer">https://docs.civicrm.org/dev/en/latest/tools/debugging/</a></p>
  
Tags: <civimail>
Title: Email Redirect to Database setting for civicrm-settings.php?
ThreadText: # Email Redirect to Database setting for civicrm-settings.php?
  
  (Asked by: username_0 on 2017-12-29)
  
  ola, i just stumbled upon the <https://github.com/ixiam/com.ixiam.modules.mailreader> extension and would love to use it on our dev/stage environment.
  
  It enables a ui to read email that were redirected to the database. now my question is: is it possible to enable DB email redirect with a line of code in civicrm.settings.php?
  
  When copying production databases to dev & stage it would be great to be able to override the mail setting to redirect to the database.
  
  So far I only found
  define('CIVICRM\_MAIL\_LOG', 1); and
  define('CIVICRM\_MAIL\_LOG', '/dev/null');
  as available settings in <https://docs.civicrm.org/dev/en/latest/tools/debugging/>
  
  **Tags:** civimail
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2017-12-29. Score: 5
  
  Yes its possible to set Outbound email to 'Redirect to Database' by simply adding 2 lines in your civicrm.settings.php
  
  ```
  global $civicrm_setting;
  $civicrm_setting['Mailing Preferences']['mailing_backend']['outBound_option'] = 5;
  
  ```
  
  **Note:** If `global $civicrm_setting;` is already present then no need to add it.
  
  > **Comments:**
  > **username_1**: username_0, Did the setting work?  
  
  ---
  
  ### Answer by username_2 on 2017-12-29. Score: 0
  
  $civicrm\_setting['Mailing Preferences']['mailing\_backend']['outBound\_option'] = 5;
  
  > **Comments:**
  > **username_3**: Thanks for your answer.  It would be helpful to others if you could edit it to provide a bit more detail.  
  
  ---
  
  