Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed to authenticate password using codeigniter

Failed to authenticate password. Error: 534-5.7.14 Please log in via your web browser and then try again. 534-5.7.14 Learn more at 534 5.7.14 https://support.google.com/mail/bin/answer.py?answer=78754 wv1sm5867206pab.37 - gsmtp

function index() {

     $config = Array(
       'protocol' => 'smtp',
       'smtp_host' => 'ssl://smtp.googlemail.com',
       'smtp_port' => 465,
       'smtp_user' => '[email protected]',
       'smtp_pass' => '92135108845129',
       'mailtype' => 'html',
       'charset' => 'iso-8859-1',
       'wordwrap' => TRUE  

     );

     $this->load->library('email', $config);
     $this->email->set_newline("\r\n");
     $this->email->from('[email protected]', 'Gaurav kwatra');
     $this->email->to('[email protected]');
     $this->email->subject('This is an email test');
     $this->email->message('Emial Testing');

      //$this->email->initialize($config);

     if($this->email->send())
     {
         echo 'Your email sent...!!!! ';
     }
     else 
     {
         show_error($this->email->print_debugger());
     }
 }
//end of code

I use above code to send mail from codeigniter....I have an error...Failed to authenticate. Password is correct.

like image 263
Gaurav Avatar asked Oct 04 '14 13:10

Gaurav


People also ask

Does CodeIgniter support internal authentication?

Authentication. CodeIgniter intentionally does not provide an internal authentication or authorization class. There are a number of great third-party modules that provide these services, as well as resources in the community for writing your own.

How to enable CodeIgniter error handling in composer?

You can invoke the command to download the Codeigniter app, though you must have Composer configured in your system. Second method is straightforward, visit Codeigniter site and download the Codeigniter application. You may turn on the feature to errors, go to the app/Config/Boot/production.php and change display_errors prop value to 1 from 0.

Does Google automatically disable the password authentication when not in use?

And after a few months of disuse I'm on the CI system again and it seems to fail to authenticate the password, be aware that Google will automatically disable this setting when not in use. It's time for you to reactivate it. Thanks for contributing an answer to Stack Overflow!

How to download the CodeIgniter app?

There are two standard methods to download the codeigniter app. You can invoke the command to download the Codeigniter app, though you must have Composer configured in your system. Second method is straightforward, visit Codeigniter site and download the Codeigniter application.


1 Answers

You would need to go to your account settings https://www.google.com/settings/security and you would need to enable Access for less secure apps which helps to use the google smtp for clients.

Please have a look here too

like image 179
Avinash Babu Avatar answered Oct 12 '22 00:10

Avinash Babu