本文整理汇总了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]',
]