ローカル開発環境で WAMP サーバーをセットアップしました (php_openssl 拡張機能が有効になっています)。Code Igniter をインストールし、GMail (実際には Google Apps) を使用してテスト メールを送信する TankAuth を構成しようとしました。
設定のために次のURLを調べました
- http://ellislab.com/codeigniter/forums/viewthread/84689/P15 (CI2 のコメント 30)
- CodeIgniter を使用してメールを gmail に送信すると、「メッセージが送信されました」と表示されますが、受信トレイには何もありませんか?
- Gmail を使用して電子メールを送信するように WAMP (localhost) を構成するにはどうすればよいですか?
上記の入力に基づいて_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'] = "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設定でも有効になっています