Google block authentication when send mail using gmail SMTP



When you send mail using Gmail SMTP service then google block your authentication and mail not send to the receiver. Now let's check why and how we can resolve this problem.


What is SMTP and Why use Gmail SMTP?



Ans. SMTP means Simple Mail Transfer Protocol, it just a protocol which gives some rule and regulation to send mail to each other. Here proper authentication is performed for mail will send to an actual person.


There are many SMTP service provider on the market on the best site is 

  • SendinBlue.
  • Mailgun
  • SendGrid
  • Amazon SES
  • G Suite
  • Postmark
  • Office365

These are the best SMTP provider but it is not free. It takes some fees so we use Gmail SMTP which is free to use.



Why we need mail send feature?


Using mail we can do many operation likes 
  • User authentication 
  • password reset
  • success message send 
  • user login credentials like user id and their password  
These are the main operation which will need in our project. And for that we need some platform which give rich user database and easy to implement. All this are fulfill by the Gmail.So that we use the gmail because it have rich use access and more secure and give all the permission to integrate our project,   


Gmail Integration problem 


Gmail is popular because of its security like 2-step password authentication and it real time notification when a new device can access our gmail account. That's make is more secure compare to other platform. Because of this we have the problem when we use Gmail as a platform to use the mail transfer system. When you send mail you need a gmail account and login credentials like user id and password. When gmail SMTP server authenticate our account, it block the authentication because our machine use a virtual device and gmail think that some one is try to perform some illegal operation to our account.This is the mail problem you face when you use the Gmail SMTP server. So let's get solve this problem.



Gmail block authentication 


In Gmail there are multiple security features are present like 2-step verification third-party authentication. These make a problem when we try to use Gmail SMTP in our project.

After writing the code and run an error is shown in that error a link is given.

This error is shown because our Gmail has the security feature called "Less secure app accessthat is turned on so that Gmail block authorize device which accesses the Gmail using username and password to send mail.


How to solve authentication problem in Gmail SMTP?


  1. Singin Gmail account and click manage our google account
  2. on the right sidebar click security
  3. search Less secure app access and open it
  4. Now on the less secure app access
Note:-After on Less secure app access it will take some time. So after 1-5 hour our application able to send the mail.

Can we send mail using other programming language without JAVA?

Ans. Yes, it is possible to use other programming language to perform this type operation like C#,Phython and you also using server server scripting language like PHP.

 

Post a Comment

Previous Post Next Post

Recent Posts