OK, what I did (not mentioned in this thread so far) was to delete the saved state file. I saw this somewhere else, tried it and it worked for me. The reason I wrote a script is that I have to do it *every* time I run Mail or it will hang again.
To do this, I created a bash script mymail.sh and run it instead of Mail:
#!/bin/bash
cd ~/Library/Containers/com.apple.mail/Data/Library/Saved\ Application\ State
rm -R -f com.apple.mail.savedState
open /Applications/Mail.app
and that worked for me.
Just this morning, I forgot and opened Mail the normal way and of course it hung. After a force quit, I tried again and it still hung. The problem was multiple Mail tasks still running after the main Mail program was force quit. You can view them from the command line:
ps auxw | egrep -i mail
fredlaxton 66117 0.0 0.1 2543040 13784 ?? S 6:50AM 0:00.11 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework /Versions/A/Support/mdworker -s mdworker-mail -c MDSImporterWorker -m com.apple.mdworker.mail
fredlaxton 66116 0.0 0.1 2552540 14000 ?? S 6:50AM 0:00.12 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework /Versions/A/Support/mdworker -s mdworker-mail -c MDSImporterWorker -m com.apple.mdworker.mail
fredlaxton 66115 0.0 0.1 2543040 13856 ?? S 6:50AM 0:00.12 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework /Versions/A/Support/mdworker -s mdworker-mail -c MDSImporterWorker -m com.apple.mdworker.mail
fredlaxton 66114 0.0 0.1 2543040 14128 ?? S 6:50AM 0:00.14 /System/Library/Frameworks/CoreServices.framework/Frameworks/Metadata.framework /Versions/A/Support/mdworker -s mdworker-mail -c MDSImporterWorker -m com.apple.mdworker.mail
fredlaxton 1692 0.0 0.1 2584360 19524 ?? S 4:33PM 0:00.32 /System/Library/PrivateFrameworks/MailService.framework/Versions/A/XPCServices/ com.apple.MailServiceAgent.xpc/Contents/MacOS/com.apple.MailServiceAgent
so I killed them manually from the command line by specifying the task number (the second column):
sudo kill 66117 66116 66115 66114 1692
and then verified by running:
ps auxw | egrep -i mail
again, which only showed itself (the egrep command).
Now when I run my bash script, Mail starts and acts normally, including sending and receiving email...