It sounds like you do not see the Mail window, and you are not able to quit Mail to shut down your computer. I found a couple of resources that might help with this.
It may be that the Mail window is hidden. You can follow these steps to show all windows to make it visible:
Show all open windows in an application
- Press and hold the application’s icon in the Dock. You may have to first open the application from Launchpad to see its icon in the Dock.
- From the shortcut menu that appears over the icon, choose Show All Windows or Show Recents.The smaller thumbnails are for closed documents you recently worked in.
- To make a window active, click it.
You can find the full article here (the title of the article says Lion, but it applies to other versions of OS X as well) :
If those steps do not help, you may need to force quit Mail:
To force quit an application, choose Force Quit from the Apple menu (or press Command-Option-Esc), then choose the unresponsive application in the Force Quit window, and click Force Quit.
You can find the full article here:
Thank you for posting in the Apple Support Communities.