I have gmail as the main mail account on my iPhone. Each time I set the account up, it works for a while — a few days to a month — but the becomes unable to fetch/send mail, giving the message
Cannot Get Mail. The mail server “imap.gmail.com” is not responding. Verify that you have entered the correct account info in Mail settings.
Once this problem appears, it doesn’t go away of it’s own accord (I’ve tried waiting up to a week). The only way I’ve found to fix it is to remove the gmail account from the phone (under Settings –> Mail, Contacts, Calendars –> Accounts), and then re-add it. This restores functionality fine, for another a few days/weeks, until it breaks again.
This has happened about 5 or 6 times now. It doesn’t seem to be related to a particular wifi network or data connection — I use my phone with my home wifi, two different wi-fi networks at work, many miscellaneous wi-fi networks while travelling, and on a mobile data plan, and the timing of the gmail “breakages” doesn’t seem to correlate with any of this. (One one occasion, it worked fine on my home wifi in the evening, and then was not working when I tried it first the next morning on the same network.)
My only guess is that it could be a password issue — this problem started soone after I restored my phone from backup a few months ago, and between when that backup was made and the restore happened, I’d changed my gmail password. So perhaps the outdated password is still present somewhere, and although each time I re-setup gmail on the phone I give the new password, something later causes it to switch back to trying the outdated one? But I’ve gone through my iCloud keychain in Keychain Access on my MacBook, and checked that all passwords for
smtp.gmail.com there are up-to-date.
For reference: it’s an iPhone 5c, running iOS 9.0.2.
This question sounds similar, but just a one-off, without the problem recurring.