Email functionality (contact us) not working


I have first used ushahidi back in 2015 to deploy a crowdsourcing platform for a heritage management in St. Kitts. I managed to get everything working then. Here is a prototype of it on my test server:

Recently, I had to migrate the tool to a new server. And since 2015 alot has changed, specifically with new versions of a number of dependencies. I managed to get everything up and running by finding individual fixes except the email part in the contact us. Here is the link to the migrated deployment:

I am stumped about the email issue. The sending alert part works. Also, if a message is sent through contact us, I do not receive an error as a matter of fact it says “Your message has been sent!”. At the admin end, testing the email gives this error:
Error! - Can not authenticate to IMAP server: [AUTHENTICATIONFAILED] Invalid credentials (Failure)

I have already unblocked the app from the gmail account.