Пример #1
0
def test_send_multipart():
    m = p.smtp.send_multipart('[email protected],[email protected]',
                              '{test} subject',
                              smtp.mime_text('{test} body 1', test='test'),
                              smtp.mime_text('{test} body 2', test='test'),
                              test='test')
    assert '*****@*****.**' == m['From']
    assert '*****@*****.**' == m['Reply-To'], m['Reply-To']
    assert '[email protected],[email protected]' == m['To']
    assert 2 == len(m.get_payload())
Пример #2
0
def test_mime_text():
    assert '''Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit

test''' == smtp.mime_text('{test}', test='test').as_string()