main.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:TwitterStockMonitor 作者: semaaJ 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号