$configs = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.gmail.com',
'smtp_user' => 'email@gmail.com',
'smtp_pass' => 'email',
'smtp_port' => '465'
);
$this->load->library('email', $configs);
$this->email->from('VOTE VOTE , email@gmail.com');
$this->email->to('email2@gmail.com');
$this->email->subject('Registration Verification: Continuous Imapression');
$this->email->message('Thanks for signing up!
Your account has been created, you can login with the following credentials after you have activated your account by pressing the url');
if ( $this->email->send()){
echo "pass<br>";
}else{
echo 'fail<br>';
}
该页面一直在加载。
我尝试过使用Sendmail。它实际上发送电子邮件(根据结果,它实际上返回true)但问题是我无法收到邮件。这就是我选择使用SMTP的原因。
$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
有什么建议吗?我应该使用不同的协议吗? hellppp
我已经编辑了我的php ini文件:
(在/ etc / PHP5 / apache2的/ php.ini中)
extension=php_openssl.so
extension=php_sockets.so
答案 0 :(得分:0)
在此
之后插入此行$this->load->library('email', $config);
$this->email->set_newline("\r\n");