OS X El Capitan how to stop mail opening (many) popup windows for calendar notifications? I deleted a calendar within a two days full of events (325). 

Now when I open mail I get a lot of new messages windows opening in the screen that completely stop mail usage. I believe that the invalid "from" address raises the problem asking for the user intervention, so a lot of popup mail alerts are shown on the screen completely, at least hundreds of them.

How to stop or delete this sending queue that prevents the mail app usage?
This is a copy/paste from my own answer at https://apple.stackexchange.com/a/174732/85275 with slight modifications

Changes per OS...
Since Sierra, Mail is in V4
Since El Capitan, Mail is in V3
All the rest will be the same.
If your machine has been upgraded through these OSes, you may have all 3 folders.

Try clearing the saved state, rebuilding &amp; reindexing the database...

Clear Saved State   


Switch to Finder,  Cmd ⌘   N  for a new window, then  Cmd ⌘   Shift ⇧   G  for Go To...
copy/paste ~/Library/Saved Application State/com.apple.mail.savedState then  Enter ⌅   
This is an alias to the real location, so Right-click &amp; Show Original  
Delete the entire com.apple.mail.savedState folder.


Rebuild; Re-index

Source: How to fix Apple Mail by rebuilding and reindexing the Mailbox


  Step 1: Rebuild
  Rebuilding a Mailbox in Mail sounds daunting but it really isn't.  
  
  
  Launch Mail, select one of your mailboxes and click on the Mailbox menu. At the bottom of the pane choose the Rebuild option. If you have a large mailbox, you can expect the process to take a few hours.
  You must repeat this step for each one of your Mailboxes.
  While the process takes place, you may experience system performance lag, as it can consume a lot of system resources and memory.
  
  
  Another caveat, if you use IMAP or Exchange with any of the accounts, the process will redownload every message from the server, so you'll use a lot of bandwidth.
  
  Now that you've completed these steps, work with Mail a little longer. If you are still having issues, or Mail fails to launch, you should try a manual reindex.
  
  Step 2: Re-index
  
  Manual reindexing of Mail messages is the only way to go if the  application has become so unresponsive it barely works at all, search is not functioning correctly or the app won't launch.
  
  Mail will automatically attempt to reindex your messages if it detects problems with the mailboxes, but sometimes a manual reindex is the best option. If you are still having problems with Mail after following step one, try manual reindexing.
  
  
  Quit Mail if it’s open.
  To get to your home Library folder, hold down the Option key, then in the Finder choose Go > Library.  
  In ~/Library/Mail/V2/MailData, delete any file that begins with “Envelope Index,” such as Envelope Index or Envelope Index-shm. (Before you actually delete the files, it makes sense to copy them to a folder on your desktop.)
  Launch Mail and the app will build new Envelope Index files -- this can take a long time if there are numerous messages to go through.
  If everything seems to be working correctly, you can now delete the copies of the "Envelope Index" files from your desktop.
  
  
  In most cases, these two tips should solve most Mail problems