added the logic to attach the csv file with email