Reputation: 53
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.
Upvotes: 5
Views: 21401
Reputation: 175
I have got the same problem and the solution I found by unblocking the google captcha. Google blocked my server IP sending email using their SMTP. So I had to unblock it.
To unblock the google captche:
You will get the button on google like the image bellow.
Note: You might get blocked again and anytime if you make some spam and your receiver email addresses are not exist.
So if anyone knows how to make it unblock permanently without by any google setting or something, it would be really appreciated.
Upvotes: 3
Reputation: 399
Although it was a question five years ago, today I encountered the same situation and found the correct answer as a supplement.
All CI settings are correct, the only problem lies in Google ’s security settings, go to
https://myaccount.google.com/security
And set Sign in using App Passwords, which can find options, select mail, and choose other in the options of the device, enter the name at will, such as PHP / CI, and then Google will generate a password for you to use. Please replace the password you entered in the CI email with this password, cheers.
Upvotes: 0
Reputation: 1
One of the reason can be the cpanel settings. Please try:
And select "off"
Upvotes: 0
Reputation: 4340
If it still doesn't work even after enabling less secure apps - you should login to your security area within your Google account and see if your device has been blocked. Google blocked my server so I then went to https://accounts.google.com/b/0/displayunlockcaptcha and it now allows me to send. Nothing to do with the username or password but Google blocking the device access.
Upvotes: 7
Reputation: 6252
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
Upvotes: 11