def email(handle, matches):
"""Emails a list of people"""
company_output = ', '.join([comp.upper() for comp in matches])
try:
with open('./Files/emails.txt') as f:
email_list = f.read().split()
server = smtplib.SMTP('smtp.gmail.com', 587)
server.starttls()
server.login(EMAIL, PASSWORD)
server.sendmail(EMAIL, email_list,
f'{handle} just tweeted about {company_output}. '
f'Might be time to check your shares...')
server.quit()
except smtplib.SMTPResponseException as error:
logging.debug(error)
评论列表
文章目录