Answers.Body: <p>No. Outbound mail settings are typically configured here: civicrm/admin/setting/smtp. They can't be overridden in civicrm.settings.php apart from to disable them completely by defining CIVICRM_MAIL_LOG, e.g.</p>
  
  <pre><code>define('CIVICRM_MAIL_LOG', '/var/log/civicrm_mail');
  </code></pre>
  
  <p>or </p>
  
  <pre><code>define('CIVICRM_MAIL_LOG', '/dev/null');
  </code></pre>
  
  <p>If you aren't interested in them.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-10T09:53:50.790Z
Answers.LastActivityDate: 2017-11-10T09:53:50.790Z
Answers.UserDisplayName: michaelmcandrew
Answers.Body: <p>In civicrm.settings.php</p>
  
  <p>global $civicrm_setting;
  $civicrm_setting['Mailing Preferences']['mailing_backend'] = [
   'outBound_option' => 0,
   'smtpServer' => 'localhost',
   'smtpPort' => 1025,
   'smtpAuth' => false
  ];</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-11-10T14:56:01.687Z
Answers.LastActivityDate: 2017-11-10T14:56:01.687Z
Answers.UserDisplayName: Thomas de Graaff
Body: <p>Is it possible to store the outbound mail settings in civicrm.settings.php?
  SMTP server IP address, port, user...</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-10T09:54:22.447Z
Comments.Text: If you can provide a few more details on why you want to do this, I might be able to be of more help and expand on my answer below.
Comments.UserDisplayName: michaelmcandrew
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-10T11:55:21.257Z
Comments.Text: The reason is that depending on where the site is deployed (live, staging, local machine) other outbound mail settings should be defined.
Comments.UserDisplayName: AlainB
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-10T13:50:48.740Z
Comments.Text: Another approach is to use the API to edit the settings as part of a clone to staging / local machine script.
Comments.UserDisplayName: michaelmcandrew
Tags: <email>
Title: Outbound mail config in civicrm.settings.php?
ThreadText: # Outbound mail config in civicrm.settings.php?
  
  (Asked by: username_0 on 2017-11-10)
  
  Is it possible to store the outbound mail settings in civicrm.settings.php?
  SMTP server IP address, port, user...
  
  **Tags:** email
  
  > **Comments:**
  > **username_1**: If you can provide a few more details on why you want to do this, I might be able to be of more help and expand on my answer below.  
  > **username_0**: The reason is that depending on where the site is deployed (live, staging, local machine) other outbound mail settings should be defined.  
  > **username_1**: Another approach is to use the API to edit the settings as part of a clone to staging / local machine script.  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2017-11-10. Score: 3 | Accepted answer
  
  In civicrm.settings.php
  
  global $civicrm\_setting;
  $civicrm\_setting['Mailing Preferences']['mailing\_backend'] = [
  'outBound\_option' => 0,
  'smtpServer' => 'localhost',
  'smtpPort' => 1025,
  'smtpAuth' => false
  ];
  
  
  ---
  
  ### Answer by username_1 on 2017-11-10. Score: 0
  
  No. Outbound mail settings are typically configured here: civicrm/admin/setting/smtp. They can't be overridden in civicrm.settings.php apart from to disable them completely by defining CIVICRM_MAIL_LOG, e.g.
  define('CIVICRM_MAIL_LOG', '/var/log/civicrm_mail');
  
  or 
  define('CIVICRM_MAIL_LOG', '/dev/null');
  
  If you aren't interested in them.
  
  
  ---
  
  