$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'smtp.googlemail.com',
'smtp_port' => 587,
'smtp_user' => 'example@gmail.com',
'smtp_pass' => 'password',
'mailtype' => 'html',
'charset' => 'iso-8859-1'
);
$this->email->from('example@gmail.com', 'easyfact');
$this->email->to('example@gmail.com');
$this->email->cc('example@gmail.com');
$this->email->bcc('example@gmail.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();
echo $this->email->print_debugger();
reulst网站
Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
和
Unable to send email using PHP mail(). Your server might not be configured to send mail using this method.
我使用wamppserver helf me
答案 0 :(得分:0)
您没有在任何地方使用$config
变量。呼叫
$this->email->initialize($config);
这应该可以解决你的问题。
另请参阅:Setting Email Preferences部分Codeigniter电子邮件类文档。