![](/img/trans.png)
[英]not work send email of gmail from codeigniter whit amazon ec2
[英]Codeigniter send email is goes into spam box using amazon ec2
这是我的代码:
$config = array(
'protocol' => 'smtps',
'smtp_host' => 'ssl://smtps.googlemail.com',
'smtp_user' => 'donotreply@eezybee.com',
'smtp_pass' => '******',
'smtp_port' => '465',
'mailtype' => 'html',
'smtp_timeout' => '4',
'newline' => "\r\n"
);
$this->email->initialize($config);
$this->email->to('donotreply@eezybee.com');
$this->email->cc();//$this->input->post('cctxt')
$this->email->from('donotreply@eezybee.com');
$this->email->subject('Test subject');
$this->email->message('Test message');
$this->email->send();
echo $this->email->print_debugger();
这封电子邮件即将进入垃圾邮件箱。
首先,您在Google的SMTP服务器中有一个错误,它看起来必须像
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.gmail.com',
'smtp_user' => 'donotreply@eezybee.com',
'smtp_pass' => '******',
'smtp_port' => '465',
'mailtype' => 'html',
'smtp_timeout' => '4',
'newline' => "\r\n"
);
$this->email->initialize($config);
$this->email->to('donotreply@eezybee.com');
$this->email->cc();//$this->input->post('cctxt')
$this->email->from('donotreply@eezybee.com');
$this->email->subject('Test subject');
$this->email->message('Test message');
$this->email->send();
echo $this->email->print_debugger();
然后,要使此方法起作用,您必须启用对Google帐户中安全性较低的应用的访问权限,因为您没有使用OAUTH。
祝好运!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.