【发布时间】:2017-09-27 09:02:41
【问题描述】:
我正在查看其他人的代码,需要查找 SMTP 详细信息。他正在使用 CodeIgniter,但是我无法弄清楚 SMTP 配置的设置位置。
例如,他正在发送这样的邮件:
function sendMail{
$this->load->library('email');
$this->email->set_mailtype("html");
$this->email->from($this->config->item('from_email'), $this->config->item('from_name'));
$this->email->to(test@example.com);
$this->email->subject('Subject is here');
$message = "Hello";
$this->email->message($message);
$this->email->send();
return true;
}
我看不到配置文件的设置位置。他确实在自定义配置文件中配置了from_email 项和from_name 项,但该文件仅包含这两行。
默认的config.php不包含任何smtp相关的东西..
我在哪里可以找到它的任何想法?
谢谢!
【问题讨论】:
-
您是否正在寻找在 codeigniter 中使用 gmail smtp 发送电子邮件?
-
不,我不知道那个人使用的是什么 SMTP,我需要在我的代码中使用相同的,所以我必须弄清楚它的设置。
-
$config['protocol'] = 'smtp'; $config['smtp_host'] = 'ssl://smtp.gmail.com'; //改变这个 $config['smtp_port'] = '465'; $config['smtp_user'] = 'user@gmail.com'; //改变这个 $config['smtp_pass'] = 'password';
-
您可以在 php.ini 和 sendmail.ini 中找到它。否则你必须设置在 CI
标签: codeigniter smtp