Giter VIP home page Giter VIP logo

Comments (1)

 avatar commented on July 3, 2024

Definitely shouldn't be part of scraperwiki-python, there's nothing
specific to ScraperWiki about it!

So it should be in its own module, or better using one that someone
else has made. A quick Google finds one called 'mailer'.

http://ginstrom.com/scribbles/2009/03/15/a-module-to-send-email-simply-in-python/

Happy to install as default in boxes if you need it!

Francis

On Wed, Jul 10, 2013 at 08:14:30AM -0700, paulfurley wrote:

Something like this. Request for comment :)

import smtplib

FROM_USER = '[email protected]'


def send_email(recipient, subject, body, attach=None):
    headers = [
        "From: " + FROM_USER,
        "Subject: " + subject,
        "To: " + recipient,
        "MIME-Version: 1.0",
        "Content-Type: text/html"]
    headers = "\r\n".join(headers)

    server = smtplib.SMTP('localhost', 25)
    server.ehlo()
    server.sendmail(FROM_USER, recipient, headers + "\r\n\r\n" + body)
    server.close()

Reply to this email directly or view it on GitHub:
#25

from scraperwiki-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.