Sometimes you might see a "Password incorrect" error when you sign in to Google with a third-party app, like iPhone’s Mail app.
If you’ve entered your password correctly but you’re still getting the error, here are the most common reasons for the message.
Follow the steps given in the article above article and enable 2-Step Verification in your Gmail account.
Also, by default, Google (YAHOO) may block third-party (less secure) mail clients like e.g. Outlook, Thunderbird, MailList Controller, Inbox2DB or any other third-party apps.
It is required to enable 'less secure apps' option in your Gmail account.
For Yahoo, please visit the following page.