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

All Samples(10)  |  Call(10)  |  Derive(0)  |  Import(0)
MailBase is used as the basis of lamson.mail and contains the basics of
encoding an email.  You actually can do all your email processing with this
class, but it's more raw.

src/l/a/lamson-1.3.4/lamson/mail.py   lamson(Download)
    def __init__(self, To=None, From=None, Subject=None, Body=None, Html=None):
        self.Body = Body
        self.Html = Html
        self.base = encoding.MailBase([('To', To), ('From', From), ('Subject', Subject)])
        self.multipart = self.Body and self.Html

src/l/a/lamson-HEAD/lamson/mail.py   lamson(Download)
    def __init__(self, To=None, From=None, Subject=None, Body=None, Html=None):
        self.Body = Body
        self.Html = Html
        self.base = encoding.MailBase([('To', To), ('From', From), ('Subject', Subject)])
        self.multipart = self.Body and self.Html

src/l/a/lamson-1.3.4/tests/lamson_tests/encoding_tests.py   lamson(Download)
def test_MailBase():
    the_subject = u'p\xf6stal'
    m = encoding.MailBase()
 
    m['To'] = "testing@localhost"
def test_attach_text():
    mail = encoding.MailBase()
    mail.attach_text("This is some text.", 'text/plain')
 
    msg = encoding.to_message(mail)
def test_attach_file():
    mail = encoding.MailBase()
    png = open("tests/lamson.png").read()
    mail.attach_file("lamson.png", png, "image/png", "attachment")
    msg = encoding.to_message(mail)
def test_odd_content_type_with_charset():
    mail = encoding.MailBase()
    mail.body = u"p\xf6stal".encode('utf-8')
    mail.content_encoding['Content-Type'] = ('application/plain', {'charset': 'utf-8'})
 

src/l/a/lamson-HEAD/tests/lamson_tests/encoding_tests.py   lamson(Download)
def test_MailBase():
    the_subject = u'p\xf6stal'
    m = encoding.MailBase()
 
    m['To'] = "testing@localhost"
def test_attach_text():
    mail = encoding.MailBase()
    mail.attach_text("This is some text.", 'text/plain')
 
    msg = encoding.to_message(mail)
def test_attach_file():
    mail = encoding.MailBase()
    png = open("tests/lamson.png").read()
    mail.attach_file("lamson.png", png, "image/png", "attachment")
    msg = encoding.to_message(mail)
def test_odd_content_type_with_charset():
    mail = encoding.MailBase()
    mail.body = u"p\xf6stal".encode('utf-8')
    mail.content_encoding['Content-Type'] = ('application/plain', {'charset': 'utf-8'})