I am trying to send email via google SMTP.
The code is working fine in my local windows PC in tomcat. But i got this error on my centos VPS
org.apach
Whenever a script tries to login automatically, Gmail generally blocks the script. To enable login through script do this:
If you do not have the activity in the list goto https://accounts.google.com/b/0/DisplayUnlockCaptcha and then try.
Both Tricks worked for me many times.