title: In Python how do I test that the gmail password is correct?
body: <p>I want to test whether the password entered by the user of his google account is correct or not, but I am always getting <code>INCORRECT</code> as an output</p>
  <p>How do I perform this?</p>
  <p>Before asking this question I've tried  :</p>
  <pre><code>import smtplib as s
  
  ID = input(&quot;ENTER YOUR MAIL ID&quot;)
  PASSW = input(&quot;pass&quot;)
  
  server = s.SMTP(&quot;smtp.gmail.com&quot;, 587)
  server.starttls()
  
  a = server.login(ID,PASSW)
  
  if a == True:
      print(&quot;CORRECT&quot;)
  else:
      print(&quot;INCORRECT&quot;)
  
  server.quit()
  </code></pre>