Added saving data to CSV file and sending it to email.