code: async def close(self):
          
          if self.writer is not None:
              # Close the transport:
              try:
                  self.writer.close()
              except OSError as exc:
                  if exc.errno != errno.ENOTCONN:
                      raise
  
          self.reset_state()
docs: Cleans up after the connection to the SMTP server has been closed
          (voluntarily or not).