This problem is caused by some index corruption (which in turn might be caused by some filesystem corruption) that makes messages to randomly appear in a mailbox different from where they’re supposed to be. If that mailbox happens to be
Outbox, Mail thinks the messages are waiting to be sent and dutifully proceeds to try to send them.
Verify/repair the startup disk (not just permissions), as described in the following article:
The Repair functions of Disk Utility: what's it all about?
After having fixed
all the filesystem issues, if any, and ensuring that there’s enough space available on the startup disk (a few GB, plus the space needed to make a backup copy of the Mail folder), try this:
1. Quit Mail if it’s running.
2. In the Finder, go to
~/Library/Mail/. Make a backup copy of this folder, just in case something goes wrong, e.g. by dragging it to the Desktop while holding the
Option (Alt) key down. This is where Mail stores the mail on your computer.
3. Locate
Envelope Index and move it to the Trash. If you see any other “Envelope Index”-named file there, delete it as well.
4. Move any “IMAP-”, “Mac-”, or “Exchange-” account folders to the Trash. Note that you can do this with IMAP-type accounts because they store mail on the server and Mail can easily re-create them. DON’T trash any “POP-” account folders, as that would cause all the mail stored there to be lost.
5. Open Mail. It will tell you that your mail needs to be “imported”. Click
Continue and Mail will proceed to re-create
Envelope Index — Mail says it’s “importing”, but it just re-creates the index if the mailboxes are already in Mail 2.x format.
6. As a side effect of having removed the IMAP account folders, those accounts may be in an “offline” state now. Do
Mailbox > Go Online to bring them back online.
7. As a side effect of re-creating the index, some previously read messages may become unread again. This is “normal” (and may also happen when rebuilding individual mailboxes by means of
Mailbox > Rebuild). You may fix that with
Message > Mark > As Read.
Note: For those not familiarized with the ~/ notation, it refers to the user’s home folder. That is, ~/Library is the Library folder within the user’s home folder, i.e. /Users/username/Library.