Is it possible to send an e-mail only but leave the socket turned on? Yes. In the currentMeasurement function, delete the shutDown() function call.