There must be something wrong with my app.
That would be highly unlikely.
More likely is the configuration files.
Since you are using Outlook, there isn't much chance of losing anything in Mail, so can try several nuke and pave options.
The first is to remove the Envelop Index files from the MailData folder. Look in your user Library for the Mail folder. Inside will be a V9 folder. Open that and then open MailData. Delete all of the Envelope Index files (three).
Open Mail and see if it will work. It will re-index all of the messages, indicated by it downloading all of the email messages.
If that doesn't work…
Look in your user Library for the Containers folder. Inside that, find Mail. There may be several. Get Info in each and look at the Name and extension. The one named com.apple.mail is the one you want to delete.
Open Mail and see if it works. It will act like it is starting for the first time.