doolo00026 2014-11-27 17:40
浏览 64

使用codeigniter发送电子邮件错误

I'm using this function to send email using my codeigniter project.

public function sendMail()
    {
        $config = Array(
            'protocol' => 'smtp',
            'smtp_host' => 'ssl://smtp.gmail.com',
            'smtp_port' => 465,
            'smtp_user' => 'xxxxx@gmail.com',
            'smtp_pass' => 'xxxxxxx',
            'mailtype' => 'html',
            'charset' => 'iso-8859-1',
            'wordwrap' => TRUE
        );

        $message = 'test message';
        $this->load->library('email', $config);
        $this->email->set_newline("
");
        $this->email->from('waaanjula@gmail.com');
        $this->email->to('waaanjula@gmail.com');
        $this->email->subject('Your Subject');
        $this->email->message($message);
        if($this->email->send())
        {
            echo 'Email sent.';
        }
        else
        {
            show_error($this->email->print_debugger());
        }

    }

but it gives "Failed to authenticate password. Error: 534-5.7.14" can any one please advice on this

  • 写回答

1条回答 默认 最新

  • doutui4649 2014-11-27 17:58
    关注

    I see that configuration is Ok, if you are sure about the email and password then it must be the new security strategy of Gmail, they block applications from using your account, in order to allow for this, go to this page and follow the instructions.

    评论

报告相同问题?

悬赏问题

  • ¥15 高德地图点聚合中Marker的位置无法实时更新
  • ¥15 DIFY API Endpoint 问题。
  • ¥20 sub地址DHCP问题
  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办