Fixes to sending email when the key window is an alert window.