Fixed debug mode for sending email