如何配置我的CodeIgniter应用程序以使用Amazon SES(简单电子邮件服务)发送电子邮件?
答案 0 :(得分:1)
在控制器功能中尝试这样写这段代码
$this->load->library('email');
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'email-smtp.us-east-1.amazonaws.com',
'smtp_user' => 'YOUR SMTP USERNAME',
'smtp_pass' => 'YOUR SMTP PASSWORD',
'smtp_port' => 465,
'mailtype' => 'html'
);
$this->email->initialize($config);
$this->email->print_debugger();
$this->email->from('YOUR_EMAIL_ID', 'Test From');
$this->email->to('email@example.com', 'Test To');
$this->email->subject('Test');
$this->email->message('test');
$this->email->set_newline("\r\n");
$this->email->send();
有关详情,请查看此链接http://only4ututorials.blogspot.in/2014/07/how-to-send-mail-using-codeigniter-and.html如何使用SMTP发送邮件