On my iPhone I used to get this message a lot: “Cannot get Mail. The mail server imap.gmail.com is not responding …” Have you ever seen that? It’s not consistent, it seems to come and go on a whim.
I believe I found a solution to this problem. Google has tightened the security settings on gmail access.
If you login to your Gmail account through a browser, click on the little round picture of yourself on the upper right, select My Account.
Under Sign in & Security select Connected apps & sites. Where it says “Allow less secure apps”, turn it to ON. The Mail app on your iPhone is a 3rd party app to Gmail.
This seems to have solved my problem. I have not seen the message since but, yes, it does make using Gmail a bit less secure.