Fixed bug that caused mail not be sent.