使用Spidermon和Amazon SES发送电子邮件



嗨,我是spidermon的新手,我已经阅读了文档,但不明白如何发送包含错误消息正文内容的电子邮件。有人能提供代码吗?为了供您参考,我也想添加文档。https://spidermon.readthedocs.io/

如文档中所述,您必须在settings.py文件中配置电子邮件通知:

SPIDERMON_AWS_ACCESS_KEY = INSERT_AWS_ACCESS_KEY
SPIDERMON_AWS_SECRET_KEY = INSERT_AWS_SECRET_KEY
SPIDERMON_EMAIL_SUBJECT = 'My Crawler Report'  # Or another subject
SPIDERMON_EMAIL_SENDER = 'myemail@gmail.com'  # your email that will send it
SPIDERMON_EMAIL_TO = ['...']  # List of emails that will receive the notification

还要确保您的显示器中有SendSESEmail

例如:

    monitors_finished_actions = [
        SendSESEmail,
    ]

https://spidermon.readthedocs.io/en/latest/actions.html?highlight=email#e-邮件操作

相关内容

  • 没有找到相关文章

最新更新