Apple mail can't connect to server
I use apple mail on my macbook pro to connect to two email accounts (a gmail account and an Icloud account). Recently I haven't been able to connect to either. When I run connection doctor is shows it is trying to connect to icloud (smpt.mail.me.com). It then shows connection successful but I am still offline.
MacBook Pro 15″, macOS 10.15