No connection could be made because the target machine actively refused it 52.96.79.146:993
In general you have to check your IMAP-settings if you used the right username/password/server/port/encryption. There are several things which could cause a connection problem (firewall as well). Do you have any error-message to help you?
Check below for IMAP settings for your reference
Also check less secure Apps was enabled
Hope this helps you
thanks