You did not completely delete Mail app.
Your only way out is
Backup, restore to factory, and restore from backup:-
If you can import your media to Photos or iTunes in a computer and copy important documents to a cloud server it will give you some resilience in case the restore from backup fails or if you need to ditch the backup.
(1) How to back up your iPhone, iPad, and iPod touch - Apple Support
(2) Restore your iPhone, iPad, or iPod to factory settings - Apple Support
(3) https://support.apple.com/en-us/HT204184
If the problem remains then do step (2) again but set up as new without restoring any backup. You would need to rescue your data from wherever you safeguarded it but you will lose all message history.