Apple Mail app can not connect to Gmail

TechApple Mail app can not connect to Gmail

Apple Mail is the default email client that comes with every Mac starting from OS X 10.0.Mac users depend on Apple Mail for their day-to-day email use as it gives them an easy way to manage and organize their emails and conversations.It works almost the same way as Microsoft outlook does but give you better features and search opportunities.Apple’s Mail.app works perfectly fine with all the Email service providers but sometimes it gets quite a few issues with some of the Email service providers, either due to extra layer of security applied by Email service provider or incorrect settings in the Apple Mail app.

It’s easy to set up and work with many popular email services like iCloud, Gmail, Yahoo, AOL, and Microsoft Exchange. Have multiple accounts? No problem.You can set up as many as you want.It works flawlessly but sometimes, some versions of Apple Mail app have been quite famous for having issues with Gmail and to fix this bug Apple released a separate update for Mail app which can be downloaded from App Store or directly from here

Here in this article I am going to explain the troubleshooting steps for Gmail connection problem with Apple Mail.

Issue: Gmail Inbox folder/Mailbox shows an exclamation mark, when you click on the exclamation mark it asks to take all the account online and then gives error message There may be a problem with the mail server or network,verify the settings for ‘Google’or try again.
The server returned the error:Mail was unable to connect to server “imap.gmail.com” using SSL on the default ports.Verify that this server supports SSL and that your account settings are correct.”

Apple Mail Can No Connect To Gmail
Apple Mail Can No Connect To Gmail

 

Apple Mail Can No Connect To Gmail
Apple Mail Can No Connect To Gmail

Showing exclamation mark on Gmail Inbox folder is not the only issue with Gmail, Sometimes it keeps asking for password even after entering the right one.It does not send emails, sometimes it can not send or receive both.These problems also occur due to incorrect settings in mail preferences.So we are going to discuss all those possible reasons with there fixes from basics.Below are some common error messages that you might encounter once in a while with your Apple mail.

  • There was a problem setting up the Mail account. An unknown error occurred.
  • There was a problem setting up the account.Unable to verify account name or password.
  • 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 connection to the server “imap.gmail.com” on port 25 timed out.
  • The server “imap.gmail.com” cannot be contacted on port 993
  • 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 contacts on port 993.
  • Could not connect to this Google IMAP server. Check your network connection and that you entered the correct information in the Account preferences. Also verify that the server supports SSL. If it does not, deselect the “Use SSL” checkbox in the Advanced tab of the Account preferences.
  • TS3899 Cannot get mail – the mail server “imap.gmail.com” is not responding. The correct account info is in Mail settings. How do I resolve?
  • Google Account: Sign-In attempt blocked
Troubleshooting Steps to fix Gmail Connectivity issue with Apple Mail

1. Make sure the Google Password is correct

First sign into the web version of Gmail at https://mail.google.com on the device where you are setting up your email client.Once you’re signed in, Go to the Mail menu at the top and select preferences then click on Account on the new preferences window and type in the same password in the password box.

Apple Mail Can No Connect To Gmail
Apple Mail Can No Connect To Gmail

 

Apple Mail Can No Connect To Gmail
Apple Mail Can No Connect To Gmail


After correcting the password close this preferences window and reopen the mail to see if Gmail works.If it does not, move to Step 2.

2. Make sure the mail server settings are correct

Sometimes the settings in Apple Mail preferences get altered somehow resulting in mail not connecting.So open the mail preferences window again as opened in Step-1Check the incoming mail server address and go to the advance tab to check the port no and if the SSL is checked. Match the settings in preferences window with the correct one mentioned below for incoming and outgoing mail server.

Apple Mail Can No Connect To Gmail
Apple Mail Can No Connect To Gmail


Gmail Mail Server Settings

Incoming Mail (IMAP) Server – Requires SSL
Server : imap.gmail.com
Port: 993
Requires SSL:Yes

Incoming Mail (POP3) Server – requires SSL
Server: pop.gmail.com
Use SSL: Yes
Port: 995

Outgoing Mail (SMTP) Server – requires TLS or SSL
Server: smtp.gmail.com
Use Authentication: Yes
Port for TLS/STARTTLS: 587
Port for SSL: 465

Server timeouts Greater than 1 minute, we recommend 5
Full Name or Display Name: [your Full name]
Account Name or User Name: your full email address (including @gmail.com or @your_domain.com)
Email Address: your email address (username@gmail.com or username@your_domain.com)

Password: your recent Gmail password

3. Make sure the imap / pop is enabled for your account

  • Sign in to Gmail.
  • Click the gear on the top right.
Apple Mail Can No Connect To Gmail
Apple Mail Can No Connect To Gmail
  • Select Settings.
  • Click Forwarding and POP/IMAP.
Apple Mail Can No Connect To Gmail
Enable imap and pop for Gmail
  • Select Enable IMAP/POP.
  • Click Save Changes.
Now go to the Apple mail and check if the Gmail is sending/Receiving emails.If it still does not work move on to next Step 4.

4. Create an app specific password if you have the 2-Step verification turned on

2-Step verification adds an extra layer of security.Most people only have one layer – their password – to protect their account. With 2-Step Verification, if a bad guy hacks through your password layer, he’ll still need your phone or Security Key to get into your account.
2-Step verification sends an authentication code to mobile device immediately after entering the Google Account password.Depending on how you opted to receive the code, by one-time code from the Google Authenticator app on your smartphone or via text message or phone call. You then enter the code to successfully sign in.

To use 2-Step Verification and security keys you must have a mobile phone that can receive the verification code via text message or phone call, or an Android, BlackBerry, or iPhone. These devices use the Google Authenticator mobile app to generate the verification code.

If you’ve turned on 2-Step Verification for your account, you might need to enter an App password instead of your regular password.An App Password allows 2-Step Verification users to access their account from apps or devices that do not support verification codes.

To create an App password, follow these steps:  

  • Visit your App passwords page. You may be asked to sign in to your Google Account.
  • At the bottom, Click Select app and choose “Mail.”
Generate App Password for Gmail
Generate App Password for Gmail
  • Click Select device and choose “Mac.”
  • Click Generate.
Generate App Password for Gmail
Generate App Password for Gmail
    • Follow the instructions to enter the App password (the 16 character code in the yellow bar) on your device.
    • Simply Copy this password in yellow bar and Click Done.
    • Go to the password box in Mail preferences and paste it their and close the mail preferences window.Click save if it asks.
    • Reopen the Apple Mail and it should be working fine.
If this still does not fix your problem then move on to next Step-5.
Note: If you go to your App password page and it says the settings you are looking for is not available for your accounts then it means you do not have your 2-Step verification turned on.
Apple Mail Can No Connect To Gmail
Generate App Password for Gmail

If you have iOS 8.3 on your iPhone or OSX 10.10.3 on your Mac, you will no longer have to use App passwords to use 2-Step Verification.

5. Make sure the App is not checking for new mails more than once in every 10 minutes

Make sure your Apple mail app isn’t set to check for new emails too often. If your Apple mail app checks for new messages more than once every 10 minutes, the app’s access to your account could be blocked.
To verify the settings go to the Mail preferences as shown in Step-1 and select General on the top.

Apple Mail Can No Connect To Gmail
Apple Mail Can No Connect To Gmail

Change the settings to Every 15 minutes for checking new messages then close the preferences window and follow the next Step-6.

6. Unblock the Application Access to your Google Account

When you’re trying to access your Gmail account for your business or personal use, you may encounter an error that reads “web login required,” or “invalid credentials,” which prevents you from accessing your account.This problem may stem from the server accessing your Gmail more than once every 10 minutes

As a security precaution, Google may prevent an application from accessing your account if it’s the first time, this application sign in to your account, or if it’s attempting to sign in from a new location.If you want to allow this application to access your account, you need to reset the CAPTCHA security characters set for your account.

To Reset CAPTCHA and allow your App, access to your Google Account

  • Navigate to the Google Display Unlock CAPTCHA page . If you are trying to log in to your Google Apps account for your business or website, instead type “https://www.google.com/a/yourdomain.com/UnlockCaptcha” into the browser bar of the problematic device, replacing “yourdomain” with the domain for your website.
Apple Mail Can No Connect To Gmail
Apple Mail Can No Connect To Gmail
  • Click the Continue button below
Apple Mail Can No Connect To Gmail
Apple Mail Can No Connect To Gmail
  • Sign in using the application you want to authorize access to your Gmail account within the next ten minutes. Google will remember the application after it signs in, and will allow it to access your account in the future as long as it uses the correct password.

7. Allow less secure App to Access your Google account

Google may block sign-in attempts from some apps or devices that do not use modern security standards. Since these apps and devices are easier to break into, blocking them helps keep your account safe.
To Allow less secure app to access your account..

  • Go to the “Less secure apps section” in My Account.
  • Next to “Access for less secure apps,” select Turn on. (Note to Google Apps users: This setting is hidden if your administrator has locked less secure app account access.)
Turn Access to less secure App On
Turn Access to less secure App On


Now Close all open windows and reopen Mail app to see if Gmail works.If it still does not work move to next Step-8.

8. Delete the expired/revoked certificates and old password entry saved in Keychain

If you still can’t sign in to your Gmail account, and get the “password incorrect” or similar error then it might be caused by the old password entry saved in Keychain.

Delete any expired/revoked certificates and old password entry  in Keychain Access along with anything associated with gmail.com.

  • Go to /Applications/Utilities – launch Keychain Access
  • Search for imap.gmail.com and delete the entry for that (presuming you connect via IMAP, otherwise search for pop3.gmail.com)
  • Repeat for smtp.gmail.com
Apple Mail Can No Connect To Gmail
Apple Mail Can No Connect To Gmail
  • Go back to Apple Mail and check your email, you will be prompted for your password
  • Paste in the Gmail password in the password prompt, making sure the “Remember this password in my keychain” is enabled.
  • I suggest you to restart your computer here and verify it again.

9. See if the firewall or network security is not blocking the traffic to SMTP, POP or IMAP

Sometimes even after having all the settings correct with all the option enabled for Gmail to send and receive, you still can not send or receive emails and get an “unknow network error” message.Check if the firewall or network security software are not blocking the connection.
To better diagnose the problem, you’ll need to run a telnet test, which will check that your computer can contact SMTP servers.

  • Go to /Applications/Utilities – launch Terminal.
  • Depending on what port you’re using to send, type ‘telnet smtp.gmail.com 25’ or ‘telnet smtp.gmail.com 587‘ in the prompt window and press Enter.
  • If you receive an error message after running the command, it indicates that your network administrator or security software has blocked access to Google’s servers.I suggest you to turn firewall off and also stop any network security software like McAfee internet security, Avast or Sophos Antivirus and then verify again if it works.
Apple Mail Can No Connect To Gmail
Apple Mail Can No Connect To Gmail
 
Apple Mail Can No Connect To Gmail
Apple Mail Can No Connect To Gmail
  • If it shows connected then move on to the next Step-10.

10. Change your Google password and try to reconnect.

If you have already tried all the above steps and nothing helped connecting to Gmail, reset your Google password and sign out all web sessions with the help of web version of Gmail: 
To Sign out all other web sessions

  • Login to Web version of Gmail at https://mail.google.com .
  • Under Inbox click “Details” on the bottom right hand side then click “Sign out all web sessions” on the new pop up window.
Apple Mail Can No Connect To Gmail
Apple Mail Can No Connect To Gmail

Now Revoke Google Account Access to all devices.Go to Google’s new Devices and Activity dashboard and click on the REMOVE button under account Access for the problematic device.

Apple Mail Can No Connect To Gmail
Apple Mail Can No Connect To Gmail

And then try to setup Gmail again it should definitely work.

11. If you are running Mavericks, Install Mail Update from Apple

After a lots of complaint registered against Apple Mail app for Gmail connectivity issue on OS X 10.9 Mavericks, Apple released an update to fix this bug with Gmail for OS X Mavericks.

 
Mail Update for Mavericks includes improvements to general stability and compatibility with Gmail, including the following:
▪ Fixes an issue that prevents deleting, moving, and archiving messages for users with custom Gmail settings
▪ Addresses an issue that may cause unread counts to be inaccurate
▪ Includes additional fixes that improve the compatibility and stability of Mail

12. Delete Offline Mail Cache folder

If your mailbox is constantly spinning and mail is not coming or going, it means IMAP is not syncing with Gmail’s Servers. In this case, try these steps:
1. First of all make all hidden file visible by typing the following command in terminal.
    defaults write com.apple.finder AppleShowAllFiles TRUE;killall Finder
2. Close mail.app.
3. Go to /Users/your_profile/Library/Mail/IMAP-account_concerned/.
4. Delete hidden folder .OfflineCache.
5. Start mail.app again.
6. A new OfflineCache folder will get created.
Note: This will not delete any messages.

13. Reconfigure your Mail account as a Fresh.

a ). Click on Apple Icon on top left hand corner, then go to System Preferences > Internet Accounts.
b ). Remove all email accounts on the left or just the problematic one.

Apple Mail Can No Connect To Gmail
Apple Mail Can No Connect To Gmail

c ). Press Command+Shift+G from the Mac desktop (or Finder > Go > Go to Folder) and type in ~/Library to go to the current user’s Library.
d ). Move the Mail folder to desktop.(All your email are stored here which you can restore from this folder- Read how to restore emails. )
e ). Go to Preferences folder and delete the following files.
Com.apple.mail.plist
Com.apple.MobileMeAccounts.plist

f ). Also delete ~/Library/Saved Application State/Com.apple.mail.savedState and this time restart your Mac then Re open Apple  Mail app to setup your Gmail account as a fresh.
Nasir Sohail
Nasir Sohail
Nasir is a software engineer with an M.Sc. degree in software engineering and various certifications related to computer hardware and networking, such as MCSE, CCNA, RHCE. He has more than 15 years of mixed industry experience mostly related to IT Support, Web development and Server administration. He also offers his freelancing gig for IT support and consultancy and has more than 300 five-star reviews across platforms like Fiverr, Google, TrustPilot, etc.
Watch & Subscribe Our YouTube Channel
YouTube Subscribe Button

Latest From Hawkdive

You May like these Related Articles

3 COMMENTS

  1. Thanks for this in depth article. I've been having issues with this for months. Any ideas on what I can do if the "Automatically detect and maintain account settings" is checked, but grayed out so I can't change it? (Also grayed out and unchangeable are: incoming mail settings, use IDLE command if the server supports it and compact mailboxes automatically.) Thanks for your time!

  2. This feature of automatically detecting and maintaining account settings in Mail on your Mac was introduced in OS X Yosemite v10.10 and this allow mail app to change the Port, SSL option,authentication option and user name ( to decide whether withor without domain name ) to the best settings available with apple's server.If the changes don't resolve the issue, Mail restores your previous settings. You could check your email account settings for mail client setup at https://www.apple.com/in/support/mail-settings-lookup/.

    If the option "Automatically detect and maintain account settings" or incoming mail server settings are grayed out that means you let the mail app automatically configure your email account at the the time of setting up this email account.You need to set up your account manually if you want to keep these settings changeable.Also when automatically detect option is checked, your mail doesn't change settings that are working, so it's best to leave this feature turned on and find other reason why your mail is not working.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.