Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)
Easy wrapper for sending a single message to a recipient list. All members
of the recipient list will see the other recipients in the 'To' field.

If auth_user is None, the EMAIL_HOST_USER setting is used.
If auth_password is None, the EMAIL_HOST_PASSWORD setting is used.

Note: The API for this method is frozen. New code wanting to extend the
functionality should use the EmailMessage class directly.

        def send_mail(subject, message, from_email, recipient_list,
              fail_silently=False, auth_user=None, auth_password=None,
              connection=None):
    """
    Easy wrapper for sending a single message to a recipient list. All members
    of the recipient list will see the other recipients in the 'To' field.

    If auth_user is None, the EMAIL_HOST_USER setting is used.
    If auth_password is None, the EMAIL_HOST_PASSWORD setting is used.

    Note: The API for this method is frozen. New code wanting to extend the
    functionality should use the EmailMessage class directly.
    """
    connection = connection or get_connection(username=auth_user,
                                    password=auth_password,
                                    fail_silently=fail_silently)
    return EmailMessage(subject, message, from_email, recipient_list,
                        connection=connection).send()
        


src/f/l/Flask-Email-1.4.4/tests/__init__.py   Flask-Email(Download)
from flask.ext.email.backends.dummy import Mail as DummyMail
from flask.ext.email.message import EmailMessage
from flask.ext.email import get_connection, send_mail, send_mass_mail, mail_managers, mail_admins
 
import unittest
        # Send using non-default connection
        connection = get_connection('tests.CustomMail')
        send_mail('Subject', 'Content', 'from@example.com', ['to@example.com'], connection=connection)
        self.assertEqual(mail.outbox, [])
        self.assertEqual(len(connection.test_outbox), 1)

src/f/l/Flask-Email-1.4.4/tests/console.py   Flask-Email(Download)
# -*- coding: utf-8 -*-
from __future__ import with_statement
 
from flask.ext.email import get_connection, send_mail
 
        s = StringIO()
        connection = get_connection(self.EMAIL_BACKEND, stream=s)
        send_mail('Subject', 'Content', 'from@example.com', ['to@example.com'], connection=connection)
        self.assertTrue(s.getvalue().startswith('Content-Type: text/plain; charset="utf-8"\nMIME-Version: 1.0\nContent-Transfer-Encoding: 7bit\nSubject: Subject\nFrom: from@example.com\nTo: to@example.com\nDate: '))