Is there a way to send an automatic email and also

Is there a way to send an automatic email and also to deactivate their website the users when their payment failed ?