0

I send mail using CodeIgniter, but it returns this error:

Failed to authenticate password. Error: 535-5.7.8 Username and Password not accepted

Here is my code:

 $this->load->library('email');
        $config = Array(
            'protocol' => 'smtp',
            'smtp_host' => 'ssl://smtp.googlemail.com',
            'smtp_port' => 587,
            'smtp_user' => 'my@gmail.com',
            'smtp_pass' => 'mypass',
            'mailtype'  => 'html',
            'charset'   => 'iso-8859-1'
        );
        $this->load->library('email', $config);
        $this->email->from('my@gmail.com');
        $this->email->to('send@gmail.com');
        $this->email->subject('This the test');
        $this->email->message('this is the test message');
        if (!$this->email->send())
        {
            echo $this->email->print_debugger();

        }

I've configured my Xampp server using this question: How to configure XAMPP to send mail from localhost?

Veve
  • 6,643
  • 5
  • 39
  • 58
Mona
  • 31
  • 1
  • 1
  • 5
  • This is a response from the mail server. It sounds like you're using the wrong username and password for that server. – miken32 Jun 26 '17 at 17:10

1 Answers1

0

Change the smtp port to 465 if you are using ssl.

JMS786
  • 1,103
  • 2
  • 11
  • 22