我想Amazon昨天宣布SES(简单邮件服务)支持SMTP。
我试图用Codeigniter发送SMTP电子邮件,但没有成功。
我已经验证了发件人,并且一切看起来都很好:
$this->load->library('email');
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'email-smtp.us-east-1.amazonaws.com',
'smtp_user' => 'SMTP USERNAME',
'smtp_pass' => 'SMTP PASSWORD',
'smtp_port' => 465,
'mailtype' => 'html'
);
$this->email->initialize($config);
$this->email->print_debugger();
$this->email->from('verified_email_address@something.com', 'Test From');
$this->email->to('email@example.com', 'Test To');
$this->email->subject('Test');
$this->email->message('test');
$this->email->send();
我尝试了以下smtp_host:
- email-smtp.us-east-1.amazonaws.com
- tls://email-smtp.us-east-1.amazonaws.com
- ssl://email-smtp.us-east-1.amazonaws.com
当我echo print_debugger()时,我得到:
220 email-smtp.amazonaws.com ESMTP SimpleEmailService-194655181
hello: 421 Timeout waiting for data from client.
这些测试运行在一个 Mediatemple (gs) 服务器上。