We recently had a migration to Office 365, some Iphones would not connect to the office 365 email, hanging at verifying server. It seems to be some kind of caching problem, and the phone at this stage will not let you enter manual settings.
The solution is to go to settings>general settings>reset>reset network settings.
The phone will reboot and then setup will generally proceed OK. Some needed the server setting putting in manually (this field is available after the reset) .. outlook.office365.com