hi i am using swiftmailer component in my app and am looking for a way to have a separate config (perhaps in config folder?) for swiftmailer that checks what debug mode i am using and thus uses different settings?
case 1: on production mode use simple smtp server without auth.
case 2: on debug mode use gmail settings or other settings since i am developing locally
is this possible?
the settings code case 1:
$this->SwiftMailer->smtpHost = '';
the settings code case 2:
$this->SwiftMailer->smtpType = '';
$this->SwiftMailer->smtpHost = '';
$this->SwiftMailer->smtpPort =;
$this->SwiftMailer->smtpUsername = '';
$this->SwiftMailer->smtpPassword = '';
I think the quickest way would be:
Now where to put it on.
I would suggest the Controller constructor, that way it’s nice and tidy.
For the values you can always use a private config file:
You can find a more generic example on Configuration Class v 1.2 and Configuration Class v 1.3.
They seem to have the same content, so it seems that it hasn’t changed from 1.2 to 1.3.
Hope it helps.