Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Codeigniter 将点火器电子邮件配置编码为config.php_Codeigniter - Fatal编程技术网

Codeigniter 将点火器电子邮件配置编码为config.php

Codeigniter 将点火器电子邮件配置编码为config.php,codeigniter,Codeigniter,我已经将电子邮件配置放在config.php中,但我不知道如何在控制器中访问它们 在my config.php中: /*EMAIL CONFIG*/ $config['protocol'] = 'smtp'; $config['smtp_host'] = 'ssl://smtp.googlemail.com'; $config['smtp_user'] = 'username'; $config['smtp_pass'] = 'pass'; $config['smtp_port'] = '465

我已经将电子邮件配置放在config.php中,但我不知道如何在控制器中访问它们

在my config.php中:

/*EMAIL CONFIG*/
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
$config['smtp_user'] = 'username';
$config['smtp_pass'] = 'pass';
$config['smtp_port'] = '465';
$config['mailtype'] = 'html';
我应该创建超级全局对象的实例吗


提前感谢。

您可以通过以下方式访问:

$this->config->item('protocol');

另外,请参阅

中的相关章节,您不需要将电子邮件配置设置放在config.php中。创建一个名为email.php的新文件,并将其放置在config文件夹中。CI将自动检测该文件中的电子邮件配置设置

查看“在配置文件中设置电子邮件首选项”