Error while setting up mail account in Nextcloud

I was trying to connect mail account manually but says error while connecting to mail. Email server is working fine. I created an App password and tried to connect. Also, IMAP is enabled in email.