@Arivu
follow the steps
- Sign in to your Google Account.
- Click Security.
- Under Signing in to Google, click App Passwords. You may need to sign in. If you don’t have this option, it might be because:
- 2-Step Verification is not set up for your account.
- 2-Step Verification is only set up for security keys.
- Your account is through work, school, or other organization.
- You turned on Advanced Protection.
- Click Select app and choose the app.
- Click Select device and pick the device you’re using.
- Click Generate.
- Follow the instructions to enter the app password. The app password is the 16-character code in the yellow bar on your device.
- Tap Done.
check this reference :
Get IMAP Mail Messages: Application-specific password required