diff --git a/Config/email.php b/Config/email.php new file mode 100644 index 0000000..2a76a6c --- /dev/null +++ b/Config/email.php @@ -0,0 +1,55 @@ + The name of a supported transport; valid options are as follows: + * Mail - Send using PHP mail function + * Smtp - Send using SMTP + * Debug - Do not send the email, just return the result + * You can add custom transports (or override existing transports) by adding the + * appropriate file to app/Network/Email. Transports should be named 'YourTransport.php', + * where 'Your' is the name of the transport. + * from => + * The origin email. See CakeEmail::from() about the valid values + * + * @see http://book.cakephp.org/2.0/en/core-utility-libraries/email.html#configuration + */ +class EmailConfig +{ + /** + * Default email config. Provide your own data + * @var array + */ + public $default = array( + 'transport' => 'Mail', + 'from' => array(), + 'returnPath' => null, + ); + + public function __construct() { + $defaultEmail = 'croogo@' . preg_replace('#^www\.#', '', strtolower($_SERVER['SERVER_NAME'])); + if(empty($this->default['from'])) { + $this->default['from'][$defaultEmail] = Configure::read('Site.title'); + } + if(empty($this->default['returnPath'])) { + $this->default['returnPath'] = $defaultEmail; + } + } +}