0
我是初學者到笨,我想從笨發送電子郵件到Gmail,代碼如下圖所示,在電子郵件笨:發送電子郵件時出錯
電子郵件配置。控制器
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.google.email.com',
'smtp_port' => '465',
'smtp_user' => '[email protected]',
'smtp_pass' => '*****'
);
然後我加載庫
$this->load->library('email',$config);
然後我所需要的數據是過時從,到,密碼,主題和消息的電子郵件庫中,
$this->email->from('[email protected]');
$this->email->to('[email protected]');
$this->email->subject('this is testing email');
$this->email->message('It is working');
最後我檢查我的電子郵件是否通過使用休閒條件發送或不發送
if($this->email->send()==true){
echo "your mail was sent";
}
else{
show_error($this->email->print_debugger());
}
那麼你有什麼?我的意思是錯誤信息? –
請參考這裏的答案 http://stackoverflow.com/questions/18855016/unable-to-send-email –