Write the network data to DB.  Add function to send csv file by mail