Hi and welcome to Mac Help
I'm wondering which macOS version you are using and how much free space you have on your Mac.
You could try deleting the Mail Plist which is basically Mail's preference file. When you restart and launch Mail a new preference Plist file is created. If the error message doesn't reappear it's safe to delete the com.apple.mail.plist file you dragged to your desktop earlier.
Follow these steps:
Click on your desktop image to go to Finder on your Mac
Click on 'Go' followed by 'Go To Folder' from the top menu
Type in or copy & paste the following: ~/Library/Containers/com.apple.mail/Data/Library/Preferences
Look for com.apple.mail.plist & drag it out to your desktop
Restart your Mac and then launch the Mail program & report back here if the error persists.