code: def send_mail(recipient, sender, subject="", content="", smtp_host="127.0.0.1", smtp_port=25):
      
      try:
          server = smtplib.SMTP(smtp_host, smtp_port)
      except Exception as e:
          logger = logging.getLogger(__name__)
          logger.warning("cannot create SMTP server: {}".format(e))
          return False
  
      header = "From: {}\r\nTo: {}\r\nSubject: {}\r\n\r\n".format(sender, recipient, subject)
      server.sendmail(sender, recipient, header + content)
  
      return True
docs: Lightweight mail functionality. Sends an mail from *sender* to *recipient* with *subject* and
      *content*. *smtp_host* and *smtp_port* are forwarded to the ``smtplib.SMTP`` constructor. *True*
      is returned on success, *False* otherwise.