code: def close(self):
          
          self.is_closed = True
          try:
              self.smtp.quit()
          except (TypeError, AttributeError, smtplib.SMTPServerDisconnected):
              pass
docs: Close the connection to the SMTP server