PHP create Excel spreadsheet and then email it as an attachment

PHP create Excel spreadsheet and then email it as an attachment

I’m using the following code:
< ?php $data = $_REQUEST['datatodisplay']; header("Content-Type: application/vnd.ms-excel"); header("Content-Disposition: attachment; filename=Data.xls"); header("Pragma: no-cache"); header("Expires: 0"); echo $data; ?>

This is what i call when the user hits a submit button. But what i’m interested in doing is sending an Excel spreadsheet as … Read more

Styling HTML e-mail

Styling HTML e-mail

When creating an HTML e-mail how do you specify the appearance, for example the font? Is there a better way than using inline CSS? I’m using cfmail to send e-mails.

Solutions/Answers:

Solution 1:

You can style it

Read more

Sending e-mail after scrape in scrapy

Sending e-mail after scrape in scrapy

pipeline.py code
class Examplepipeline(object):

def __init__(self):
dispatcher.connect(self.spider_opened, signal=signals.spider_opened)
dispatcher.connect(self.spider_closed, signal=signals.spider_closed)

def spider_opened(self, spider):
log.msg(“opened spider %s at time %s” % (spider.name,datetime.now().strftime(‘%H-%M-%S’)))

def process_item(self, item, spider):
log.msg(“Processsing item ” + item[‘title’], level=log.DEBUG)

def spider_closed(self, spider):… Read more