I wrote this function :
def closed_handler(self, spider):
stats = self.crawler.stats.get_stats()
mailer = MailSender()
mailer.send(to=["me@me.com"], subject="Scrap Ended", body="Today "+str(time.strftime("%d/%m/%Y %H:%M:%S"))+" scrap is over. Check results : "+str(stats), cc=["him@me.com"])
log.msg("closed_handler", level=log.DEBUG)
Activated in init function like so :
SignalManager(dispatcher.Any).connect(self.closed_handler, signal=signals.spider_closed)
It works well when I manually launch spider but once in a python egg for launching it with scrapyd, I don't receive emails anymore. I don't find any informations in scrapyd doc about email configuration nor logs which could give me a clue. Can anybody who already achieve this give feedback ? Thanks !