won't connect to map server
all of a sudden on my 2010 MacBook pro with os Sierra my apple email app won't connect to yahoo or gmail imap servers. i am connected to the internet and when i click on connection doctor it will connect to the smtp but not the imap any help would be greatly appreciated on solving this problem.
MacBook Pro (13-inch Mid 2012), macOS Sierra (10.12.4)