With all your accounts active, when you are composing a message be sure to check a dropdown menu on the right above your text. It is there so you can choose which server to use for the account you are using. There is also an option in Mail to use the server for the account in use. Be sure to check that option. Maybe that will help. Otherwise, you can try the following to see if it helps with Mail.
You should try each, one at a time, then test to see if the problem is fixed before going on to the next.
- Shutdown the computer, wait 30 seconds, restart the computer.
- Disconnect all third-party peripherals.
- Resetting your Mac's PRAM and NVRAM
- Test in safe mode to see if the problem persists, then restart normally. Use safe mode to isolate issues with your Mac and Playing Safe - what does Safe mode do?
- Repair permissions on the Home folder: Resolve issues caused by changing the permissions of items in your home folder.
- Create a New User Account Open Users & Groups preferences. Click on the lock icon and enter your Admin password when prompted. On the left under Current User click on the Add [+] button under Login Options. Setup a new Admin user account. Upon completion log out of your current account then log into the new account. If your problems cease, then consider switching to the new account and transferring your files to it - Transferring files from one User Account to another.
None of the above may help, but they are worth trying. Sometimes they can resolve problems with Mail. If they don't, then you should restore your previous system from your backup or reinstall macOS:
Reinstall El Capitan or Later Without Erasing Drive
Please be sure you back up, if possible.
- Restart the computer. Immediately, at or before the chime, hold down the Command and R keys until the Apple logo and progress bar appear. Wait until the Utility Menu appears.
- Select Disk Utility and click on the Continue button.
- Select the indented (usually, Macintosh HD) volume entry from the side list.
- Click on the First Aid button in Disk Utility's toolbar. Wait until the Done button activates, then click on it.
- Quit Disk Utility and return to the Utility Menu.
- Select Install OS X and click on the Continue button.