Adding mail functionality to alarming code