what I've done to solve it. is to turn on the less secure app.
after connecting to my gmail account. I entered this link: https://www.google.com/settings/security/lesssecureapps
Then I turn on the secure app and, and the it worked.
it has been said also above