我已經在本地開發環境(啓用了php_openssl擴展)上安裝了WAMP服務器。我安裝了Code Igniter並嘗試配置TankAuth,我想在其中使用GMail(實際上是Google Apps)發送測試郵件。CodeIgniter tankauth不能與GMail一起工作
我通過以下URL拍得配置
- http://ellislab.com/codeigniter/forums/viewthread/84689/P15(評論30 Cl 2)
- Sending email to gmail with CodeIgniter displays "message sent" but there nothing in the inbox?
- How to configure WAMP (localhost) to send email using Gmail?
基於來自上述輸入,我更新罐的_send_email
功能身份驗證如下
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'] = "[email protected]";//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中也能設置
感謝您的回覆拉米羅。日誌文件中沒有顯示錯誤。作爲一個商業解決方案,郵戳不適合我的項目,因爲我正在開發開源項目。我正在嘗試auth庫,並且肯定也嘗試了DDAuth,但不是因爲我到目前爲止,無法配置TankAuth。 –