我有四个python函数用于发送邮件。如果程序做了一件事,它会将一组结果发送给多个收件人;如果程序做了另一件事,则会有一个单独的函数将结果发送给一个收件人。在def smail(to,sub,body):
addr_from = 'alert@example.com'
msg = MIMEMultipart()
msg['From'] = addr_from
msg['To'] = to
msg['Subject'] = sub
msg.attach(body)
s = smtplib.SMTP('webmail.example.com')
s.sendmail(addr_from, [to], msg.as_string())
s.quit()
def email_format2(results):
text = ""
text += 'The following applications in are non-compliant\n'
text += '
'
text += 'Here are there names and locations. Please inform the developer.'
text += '
'
text += '
'
table = pd.DataFrame.from_records(results)
table_str = table.t