close connection after sending email