In this case, you can reset your network settings to fix the issue. Please try the steps below.
- Delete one of the accounts.Settings > Mail, Contacts, Calendars > iCloud, Exchange, .... account > Delete Account
- Reset Network SettingsSettings > General > Reset > Reset Network SettingsThe phone will reboot.
- After the phone rebootsDon't add any WiFi networks, until after you set up your account againSet up your iCloud, Exchange, .... account againSettings > Mail, Contacts, Calendars > Add AccountFill in all your settingsAfter that, your account should sync up.
- Once you've verified that the account is working, then you can add your WiFi network back in, and it should keep working.