SMTP Error: Could not authenticate [closed]

our team had enabled two factor authentication for mail so for this reason i am getting error.
after disabling the two factor authentication SMTP is working.