Android アプリの Web サービスを開発していますが、メール機能がうまく動作しません。このチュートリアルに従ってくださいHERE .
そして私のコントローラーにはこれがあります:
function forgotPassword_get(){
$this->load->model('model');
$this->response->format = 'json';
$email = $this->get('email');
$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
// gmail specific settings here
$config['smtp_host'] = 'smtp.gmail.com';
$config['smtp_user'] = 'my email here';
$config['smtp_pass'] = 'password here';
$config['smtp_port'] = '465';
$config['wordwrap'] = TRUE;
$this->load->library('email');
$this->email->initialize($config);
$this->email->from('mailfrom', 'sample name');
$this->email->to('mailto');
$this->email->subject('sample email');
$this->email->message('sample message for email.');
$this->email->send();
echo $this->email->print_debugger();
}
結果は
Your message has been successfully sent using the following protocol: sendmail
User-Agent: CodeIgniter
Date: Tue, 29 Oct 2013 15:45:57 +0800
From: "sample name"
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <526f67b5f16b8@mobilemo.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
sample message for email.
メールは正常に送信されたと表示されますが、メールが受信トレイに届いていないようです。
誰かが私を助けてくれますか、私は何かを逃したと思います。前もって感謝します。