def notify(self, title, text, url=None):
        msg = MIMEMultipart()
        msg['From'] = self.fromaddr
        msg['To'] = self.toaddr
        msg['Subject'] = title
        body = text if url else text + '\nURL: ' + url
        msg.attach(MIMEText(body, 'plain'))
        if self.use_ssl:
            server = smtplib.SMTP_SSL(self.host, self.port)
        else:
            server = smtplib.SMTP(self.host, self.port)
        server.ehlo()
        if self.use_starttls:
            server.starttls()
            server.ehlo()
        if self.login_required:
          server.login(self.fromuser, self.frompwd)
        text = msg.as_string()
        server.sendmail(self.fromaddr, self.toaddr, text)
Sends mail using a Jinja template with autoescaping turned off.
dataset/ETHPy150Open MA3STR0/kimsufi-crawler/notifiers/email_notifier.py/EmailNotifier.notify--crossover with--dataset/ETHPy150Open mozilla/addons-server/src/olympia/amo/utils.py/send_mail_jinja