Hey there! Good advice so far. Definitely check space and network connection, and if your other devices are working fine:
I’ve personally also had luck fixing this problem a few ways:
1): Backing up and/or exporting your mailboxes, removing your account via System Preferences > Internet Accounts, and adding it back again. However in an indexing issue this may not resolve it, but can.
2): Quit Mail, and relaunch while holding Shift on the keyboard, this will prevent and previously open windows from opening again, in case that’s what’s going on.
If it opens fine, I’d delete any open drafts, or anything currently in the outbox, quit/relaunch Mail again normally.
3): Since you’ve already tried re building the Mailboxes (And updated the OS I assume), I’d make it re index the files, (It normally does that itself, but can fail to at times but very rarely), quit the Mail app, and :
Open Finder, on the top menu click on Go, then while holding Option on the keyboard, click on “Library” in between Computer and Home.
From there open the Mail folder > V7 (Depending on your OS version) > Mail Data.
From there, remove any files beginning with “Envelope Index”.
Once done, re launch the Mail app, don’t be alarmed, it will look as if brand new, and prompt you to import your mail messages again.
In Catalina, if that doesn’t work, I do have another solution to force the mail to index again, (Without indexing the entire hard drive, which is sometimes needed), Keeping a backup is key, although IMAP accounts are stored on the server, and it’s typically safe, I still recommend keeping a backup of important mail.
Best!
Import and Export Mailboxes on Mac:
https://support.apple.com/guide/mail/import-or-export-mailboxes-mlhlp1030/mac
Backup your Mac with Time Machine:
https://support.apple.com/en-us/HT201250