本文整理匯總了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]']
示例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]']
示例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]']
示例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]']
示例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]']
示例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() == []
示例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]']
示例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]',
]