librelist archives

« back to archive

ANN: Flask-Mail 0.3

ANN: Flask-Mail 0.3

From:
Dan Jacob
Date:
2010-07-20 @ 19:07
I'm pleased to announce the release of Flask-Mail 0.3.

This release is a major refactoring to bring the API more in line with
the emerging standard for Flask extensions. It also makes sending bulk
mails more intuitive.

This release does have a couple of breaking changes, so ensure that
your application is compatible before running in production:

1.  Instead of this::

    from flaskext.mail import init_mail

    init_mail(app) # -> creates app.mail_relay

You have this:

    mail = Mail(app)

or::

    mail = Mail()
    mail.init_app(app)

2. To send a single email, do this::

    msg = Message() # configure your message
    mail.send(msg)

3. To send bulk messages:

    with mail.connect() as conn:
        conn.send(msg)

Full documentation is here:

http://packages.python.org/flask-mail/