code: def get_mime_message(subject, text):
      
      message = MIMEText(
          "<html>" +
          str(text).replace("\n", "<br>") +
          "</html>", "html"
      )
      message["subject"] = str(subject)
      return message
docs: Creates MIME message
  
      :param subject: Subject of email
      :param text: Email content
      :return: Email formatted as HTML ready to be sent