Skip to content Skip to sidebar Skip to footer

Stop Email From Sending

I am working on writing an add-on for Thunderbird and would like to be able to cancel the sending of an email under certain conditions. I have the following code which allows me t

Solution 1:

In order to prevent the email from being sent you'd need to prevent the event from bubbling up:

function send_event_handler( evt ) {
    if(shouldStopEmail) {
        evt.preventDefault();
        return false;
    }
}

window.addEventListener( "compose-send-message", send_event_handler, true );

Post a Comment for "Stop Email From Sending"