code: def send_email(self, message):
          
          msg = MIMEMultipart()
          msg['From'] = self.from_address
          msg['To'] = self.to_address
          msg['Subject'] = self.title
          msg.attach(MIMEText('<pre>' + cgi.escape(message) + '</pre>', 'html'))
          smtp = smtplib.SMTP(self.server, self.port,
                              timeout=self.timeout)
          if self.tls_auth:
              smtp.starttls()
              smtp.login(self.user, self.password)
          smtp.sendmail(self.from_address, self.to_address, msg.as_string())
          smtp.quit()
docs: Initiate a SMTP session and send an email.