<p>Currently email settings aren't multi-environment aware, so there is no native way to do this.</p>

<p>Probably worth adding to the <a href="http://feedback.buildwithcraft.com" rel="nofollow">feedback</a> site, as this has come up before, though.</p>

CC BY-SA 3.0
2015-05-05T09:36:39.963Z
Ok thanks. I would add feedback but I've run out of feedback credits!
hamishtaplin
CC BY-SA 3.0
2015-05-05T09:40:16.263Z
Just checked and I must have earned some credits—have posted feedback.
hamishtaplin
CC BY-SA 3.0
2015-05-01T17:41:03.330Z
2015-05-01T17:41:03.330Z
Brad Bell
<p>Shameless plug: We've written a plugin that automatically updates your email settings depending on your environment. It's not free, but it is cheap :-) Please <a href="http://red-robot.co.uk/our-work/email-settings-craft-cms-plug-in" rel="nofollow noreferrer">check out</a> the page on our website for more information. </p>

CC BY-SA 3.0
2017-08-02T12:52:09.577Z
2017-08-02T12:52:09.577Z
Gaz
<p>I'd like to define the SMTP server deets in my local config as I regularly need to push/pull databases between environments and will have different settings.</p>

<p>There doesn't seem to be any of doing this currently. Are there any workarounds? I thought maybe I could just put the SMTP deets in my code (testing for current enviroment) but the EmailModel class doesn't accept any of the SMTP-related properties of PHPMailer.</p>

<plugin-development><emails>
Define email environment-specific email settings?
# Define email environment-specific email settings?

(Asked by: username_0 on 2015-05-01)

I'd like to define the SMTP server deets in my local config as I regularly need to push/pull databases between environments and will have different settings.

There doesn't seem to be any of doing this currently. Are there any workarounds? I thought maybe I could just put the SMTP deets in my code (testing for current enviroment) but the EmailModel class doesn't accept any of the SMTP-related properties of PHPMailer.

**Tags:** plugin-development, emails


---

## 2 answers

### Answer by username_1 on 2015-05-01. Score: 3 | Accepted answer

Currently email settings aren't multi-environment aware, so there is no native way to do this.

Probably worth adding to the [feedback](http://feedback.buildwithcraft.com) site, as this has come up before, though.

> **Comments:**
> **username_0**: Ok thanks. I would add feedback but I've run out of feedback credits!  
> **username_0**: Just checked and I must have earned some credits—have posted feedback.  

---

### Answer by username_2 on 2017-08-02. Score: 1

Shameless plug: We've written a plugin that automatically updates your email settings depending on your environment. It's not free, but it is cheap :-) Please [check out](http://red-robot.co.uk/our-work/email-settings-craft-cms-plug-in) the page on our website for more information.


---

