我在本地开发环境中设置了 WAMP 服务器(启用了 php_openssl 扩展)。我安装了 Code Igniter 并尝试配置 TankAuth,我想在其中使用 GMail(实际上是 Google Apps)发送测试邮件。
我通过以下 URL 进行配置
- http://ellislab.com/codeigniter/forums/viewthread/84689/P15(CI2评论 30)
- 使用 CodeIgniter 向 gmail 发送电子邮件显示“已发送消息”但收件箱中没有任何内容?
- 如何配置 WAMP (localhost) 以使用 Gmail 发送电子邮件?
根据上面的输入,我更新_send_email
了 tank auth 的功能如下
function _send_email($type, $email, &$data)
{
$this->load->library('email');
$config['protocol'] = "smtp";
$config['smtp_host'] = "ssl://smtp.googlemail.com";
$config['smtp_port'] = "465";
$config['smtp_user'] = "mymail@youthpark.org";//also valid for Google Apps Accounts
$config['smtp_pass'] = "mypass";
$config['charset'] = "utf-8";
$config['mailtype'] = "html";
$config['newline'] = "\r\n";
$this->email->initialize($config);
$this->email->from($this->config->item('webmaster_email', 'tank_auth'), $this->config->item('website_name', 'tank_auth'));
$this->email->reply_to($this->config->item('webmaster_email', 'tank_auth'), $this->config->item('website_name', 'tank_auth'));
$this->email->to($email);
$this->email->subject(sprintf($this->lang->line('auth_subject_'.$type), $this->config->item('website_name', 'tank_auth')));
$this->email->message($this->load->view('email/'.$type.'-html', $data, TRUE));
$this->email->set_alt_message($this->load->view('email/'.$type.'-txt', $data, TRUE));
//$this->email->send();
if ( ! $this->email->send())
{
show_error($this->email->print_debugger());
} else {
//echo('DONE');
}
}
我收到消息mail sent..
,但实际上邮件没有发送。有人可以指出我在哪里做错了吗?
在 Gmail 设置中也启用了弹出窗口