Exception
Explanation
The reason why you are getting the above exception while trying to send an email from your code by using Gmail SMTP, is because Google is blocking you from signing in to your account due to security reasons.
Solution
In order to handle this exception go to Less secure apps section of your Google account and turn on Allow less secure apps.