【问题标题】:Codeigniter send email is goes into spam box using amazon ec2Codeigniter 发送电子邮件使用 amazon ec2 进入垃圾邮件箱
【发布时间】:2018-03-16 16:26:08
【问题描述】:

这是我的代码:

 $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();

这封电子邮件正在进入垃圾邮件箱。

【问题讨论】:

  • 错误显示验证密码失败。确保您使用的是正确的登录凭据
  • 你使用的是哪个主机......cpanel或windows
  • 登录凭据正确。 @BSB
  • 服务器是 amzon @Mahesh
  • 你试过 tls 和端口 587..?

标签: php codeigniter amazon-ec2 spam email-spam


【解决方案1】:

首先,你的 google 的 SMTP SERVER 有错误,应该是这样的

$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。

Enable access For less Secure Apps

祝你好运!

【讨论】:

  • 当我使用这个配置 aaray 时不。邮件发送停止。我的服务器是 https,所以我需要使用 smtps。现在我的问题是为什么它会进入垃圾邮件
猜你喜欢
  • 2012-05-27
  • 2012-03-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-06-25
  • 2013-10-17
  • 1970-01-01
相关资源
最近更新 更多