We suggest backing up your iPhone using iTunes, then toggle Airplane Mode on and off. Test your email connection. If the problem continues try deleting your email account then adding it back. Settings > Passwords and Accounts > Click on the account you want to remove and tap Delete Account
For additional support we encourage you to check out the conversation in Apple Support Communities for tips to resolve the 'connection to the server failed' issue.
We hope this helps!
Kenneth, AT&T Community Specialist
Need help? Ask a question to get help from the AT&T Community or support from AT&T specialists. If this reply helped you please use Accept solution to mark it as an Accepted Solution.
*I am an AT&T employee, and the postings on this site are my own and don't necessarily represent AT&T's position, strategies or opinions.