The server returned the error: The server “imap.gmail.com” cannot be contacted on port 993-Collection of common programming errors

My Mac Mail has just started going on the fritz. I have a gmail account linked to mail and also a hotmail account. Both have warning signs and I cannot send or receive mail. They were both fine yesterday. I have not updated or changed anything.

I am running OS X 10.8.2 and Mail Version 6.1 (1498).

When I click on the warning sign for gmail to ‘take it online’ I get the following message:

Unable to receive mail. There may be a problem with the mail server or network. Verify the settings for account “gmail” or try again.

The server returned the error: The server “imap.gmail.com” cannot be contacted on port 995.

…And the following for Hotmail account:

Unable to receive mail. There may be a problem with the mail server or network. Verify the settings for account “Hotmail” or try again.

The server returned the error: The server “pop3.live.com” cannot be contacted on port > 995.

I’ve tried sending mail and it shows that both gmail and hotmail are both offline.

I have been on multiple forums with this problem and it seems the whole world is having the same problem with no fix.

I’ve already tried the following to no avail:

  • I’ve checked all my info is entered correctly.

  • Changing the ‘incoming mail server’ to IMAP.googlemail.com – this got rid of the warning sign but still, will not send or receive mail. The warning sign has now changed to a ‘zig zag’ sign next to gmail.

  • Changing the port number from 995 to 993.

  • Re-entering my password.

  • Deleting the accounts and re-adding them.

Nothing works. Please does anyone have a REAL fix for this?

* Cant add this comment for some reason? But here we go:

Hi there,thank you for your fast responses. I have tried restarting my router and mail.app to no avail. Apologies – an error in my copy/pasting, the port for IMAP is 993. I just tried your terminal command and got the following: imap.gmail.com: nodename nor servname provided, or not known. I just tried adding my gmail acc. on my sisters iPhone 5 and got the following: Unable to connect to SSL, would you like to try and connect without SSL? (Yes) and got this: The IMAP server ‘imap.gmail.com’is not responding. Check your network connection and that you entered the correct information in the ‘incoming mail server’ field. Im sorry, I dont know what a VPN is.

Also, All of a sudden BOTH accounts just came back online and updated with new mails etc. I’ve ‘essentially’ not changed anything. I reset the app and the router well over 20 minutes ago prior to this. You’d think changes would be instant if that was the fix?