當前位置: 首頁>>代碼示例>>Python>>正文


Python EmailMessage.get_recipients方法代碼示例

本文整理匯總了Python中mailshake.EmailMessage.get_recipients方法的典型用法代碼示例。如果您正苦於以下問題:Python EmailMessage.get_recipients方法的具體用法?Python EmailMessage.get_recipients怎麽用?Python EmailMessage.get_recipients使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在mailshake.EmailMessage的用法示例。


在下文中一共展示了EmailMessage.get_recipients方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_cc

# 需要導入模塊: from mailshake import EmailMessage [as 別名]
# 或者: from mailshake.EmailMessage import get_recipients [as 別名]
def test_cc():
    email = EmailMessage('Subject', 'Content', '[email protected]',
        '[email protected]', cc='[email protected]')
    message = email.message()

    assert message['Cc'] == '[email protected]'
    assert email.get_recipients() == ['[email protected]', '[email protected]']
開發者ID:andrewnelder,項目名稱:MailShake,代碼行數:9,代碼來源:test_message.py

示例2: test_multiple_bcc

# 需要導入模塊: from mailshake import EmailMessage [as 別名]
# 或者: from mailshake.EmailMessage import get_recipients [as 別名]
def test_multiple_bcc():
    email = EmailMessage('Subject', 'Content', '[email protected]',
                         bcc=['[email protected]', '[email protected]'])
    message = email.render()

    assert not message['To']
    assert not message['Cc']
    assert not message['Bcc']  # as it should
    assert email.get_recipients() == ['[email protected]', '[email protected]']
開發者ID:jpscaletti,項目名稱:MailShake,代碼行數:11,代碼來源:test_message.py

示例3: test_cc

# 需要導入模塊: from mailshake import EmailMessage [as 別名]
# 或者: from mailshake.EmailMessage import get_recipients [as 別名]
def test_cc():
    email = EmailMessage('Subject', 'Content', '[email protected]',
                         cc='[email protected]')
    message = email.render()

    assert message['Cc'] == '[email protected]'
    assert not message['To']
    assert not message['Bcc']
    assert email.get_recipients() == ['[email protected]']
開發者ID:jpscaletti,項目名稱:MailShake,代碼行數:11,代碼來源:test_message.py

示例4: test_multiple_cc_and_to

# 需要導入模塊: from mailshake import EmailMessage [as 別名]
# 或者: from mailshake.EmailMessage import get_recipients [as 別名]
def test_multiple_cc_and_to():
    email = EmailMessage('Subject', 'Content', '[email protected]',
        to=['[email protected]', '[email protected]'],
        cc=['[email protected]', '[email protected]'])
    message = email.message()

    assert message['Cc'] == '[email protected], [email protected]'
    assert email.get_recipients() == ['[email protected]', '[email protected]',
        '[email protected]', '[email protected]']
開發者ID:andrewnelder,項目名稱:MailShake,代碼行數:11,代碼來源:test_message.py

示例5: test_multiple_cc

# 需要導入模塊: from mailshake import EmailMessage [as 別名]
# 或者: from mailshake.EmailMessage import get_recipients [as 別名]
def test_multiple_cc():
    email = EmailMessage('Subject', 'Content', '[email protected]',
                         cc=['[email protected]', '[email protected]'])
    message = email.render()

    print(message['Cc'])
    assert message['Cc'] == '[email protected], [email protected]'
    assert not message['To']
    assert not message['Bcc']
    assert email.get_recipients() == ['[email protected]', '[email protected]']
開發者ID:jpscaletti,項目名稱:MailShake,代碼行數:12,代碼來源:test_message.py

示例6: test_multiple_replyto

# 需要導入模塊: from mailshake import EmailMessage [as 別名]
# 或者: from mailshake.EmailMessage import get_recipients [as 別名]
def test_multiple_replyto():
    email = EmailMessage('Subject', 'Content', '[email protected]',
                         reply_to=['[email protected]', '[email protected]'])
    message = email.render()

    assert message['Reply-To'] == '[email protected], [email protected]'
    assert not message['To']
    assert not message['Cc']
    assert not message['Bcc']  # as it should
    assert email.get_recipients() == []
開發者ID:jpscaletti,項目名稱:MailShake,代碼行數:12,代碼來源:test_message.py

示例7: test_recipients_as_tuple

# 需要導入模塊: from mailshake import EmailMessage [as 別名]
# 或者: from mailshake.EmailMessage import get_recipients [as 別名]
def test_recipients_as_tuple():
    email = EmailMessage('Subject', 'Content', '[email protected]', 
        to=('[email protected]', '[email protected]'),
        cc=('[email protected]', '[email protected]'),
        bcc=('[email protected]',))
    message = email.message()

    assert message['Cc'] == '[email protected], [email protected]'
    assert email.get_recipients() == ['[email protected]', '[email protected]',
        '[email protected]', '[email protected]', '[email protected]']
開發者ID:andrewnelder,項目名稱:MailShake,代碼行數:12,代碼來源:test_message.py

示例8: test_multiple_to_cc_bcc

# 需要導入模塊: from mailshake import EmailMessage [as 別名]
# 或者: from mailshake.EmailMessage import get_recipients [as 別名]
def test_multiple_to_cc_bcc():
    email = EmailMessage('Subject', 'Content', '[email protected]',
                         to=['[email protected]', '[email protected]'],
                         cc=['[email protected]', '[email protected]'],
                         bcc=['[email protected]', '[email protected]'])
    message = email.render()

    assert message['To'] == '[email protected], [email protected]'
    assert message['Cc'] == '[email protected], [email protected]'
    assert message['Bcc'] == '[email protected], [email protected]'
    assert email.get_recipients() == [
        '[email protected]', '[email protected]',
        '[email protected]', '[email protected]',
        '[email protected]', '[email protected]',
    ]
開發者ID:alfredo,項目名稱:MailShake,代碼行數:17,代碼來源:test_message.py


注:本文中的mailshake.EmailMessage.get_recipients方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。