I am using CodeIgniter, i want to auto load the email config file and use in my controllers, libraries.
I added email config to config/autoload.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
...some code ...
*/
$autoload['libraries'] = array(
'database',
'session',
'locale',
'util/ScriptLoader',
'activity/Message',
'Auth_lib',
'email'
);
my config/email.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
...some code ...
*/
$config['useragent'] = "CodeIgniter";
$config['mailpath'] = "/usr/bin/sendmail"; // or "/usr/sbin/sendmail"
$config['protocol'] = "mail";
$config['smtp_host'] = "localhost";
$config['smtp_user'] = "";
$config['smtp_pass'] = "";
$config['smtp_port'] = "25";
$config['system_email'] = "noreply@xxxx.com";
$config['help_email'] = "help@xxxxx.com";
$config['inquiries_email'] = "inquiries@xxxx.com";
$config['support_email'] = "support@xxxx.com";
i tried to get support_email value in my controller using
$this->config->item('support_email')
but not working, how to get the auto-loaded values in controller? please help
You need to autoload config files under:
$autoload['config'] = 'email';