Ruby on Rails, Gmail and Net::SMTPAuthenticationError: 535-5.7.8 Username and Password not accepted

Are you getting following error while using Gmail SMTP?

Net::SMTPAuthenticationError: 535-5.7.8 Username and Password not accepted

The solution is simple.

  1. Go to https://www.google.com/settings/security/lesssecureapps
  2. Enable the switch marked below and you are done!

Allow Less Secure Apps