def taskSendEmail (opts):
  s = smtplib.SMTP(opts["email_info"]["smtp_server"])
  tmplbuf = getEventTemplateData(opts["event"])
  tmpl = tmplbuf % (opts["template_data"])
  if isinstance(tmpl, unicode):
    tmpl = tmpl.encode('ascii')
  msg = email.message_from_string(tmpl)
  msg["To"] = opts["rcpt_list"]
  msg["From"] = opts["email_info"]["from"]
  rplyto = opts["email_info"]["reply-to"]
  if rplyto:
    msg["Reply-To"] = rplyto
  print opts
  print msg._headers
  s.sendmail(msg["From"], msg["To"], msg.as_string())
  s.quit()
dataset/ETHPy150Open fp7-ofelia/ocf/ofam/src/src/foam/task.py/taskSendEmail/original