

def send_trap_email(recipients, sender, subject, template_env, context):
    text_template = template_env.get_template('default_email_text.tmpl').render(**context)
    html_template = template_env.get_template('default_email_html.tmpl').render(**context)
    text = MIMEText(text_template, 'plain')
    html = MIMEText(smtp, 'html')
    if isinstance(recipients, basestring):
        recipients = recipients.split(',')
    msg = MIMEMultipart('alternative')
    msg['Subject'] = subject
    msg['From'] = sender
    msg['To'] = ', '.join(recipients)
    msg.attach(text)
    msg.attach(html)
    smtp = smtplib.SMTP('localhost')
    smtp.sendmail(sender, recipients, msg.as_string())
    smtp.quit()

dataset/ETHPy150Open dropbox/trapperkeeper/trapperkeeper/utils.py send_trap_email/VarMisuse@61/99 `html_template`->`smtp`