0
我想弄清楚如何使用codeigniter發送電子郵件,併成功地使用我的Gmail帳戶。在Codeigniter中用hotmail發送郵件?
但問題是,我不知道如何使用我的Hotmail帳戶做...
繼承人它使用的Gmail代碼:
<?php
class Email extends CI_Controller
{
function index()
{
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => '[email protected]',
'smtp_pass' => 'Password'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('[email protected]', 'Me');
$this->email->to('AnotherGuy');
$this->email->subject('This is an email test');
$this->email->message('It is working. Great!');
if($this->email->send())
{
echo 'Your email was sent.';
}
else
{
show_error($this->email->print_debugger());
}
}
}