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


Python EmailMessage.to方法代碼示例

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


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

示例1: test_get_namespaces

# 需要導入模塊: from cybox.objects.email_message_object import EmailMessage [as 別名]
# 或者: from cybox.objects.email_message_object.EmailMessage import to [as 別名]
    def test_get_namespaces(self):
        m = EmailMessage()
        m.to = "[email protected]"
        m.subject = "Here's a cool picture"
        m.links = Links()
        u = URI("http://example.com/cool.jpg", URI.TYPE_URL)
        m.links.append(u.parent.id_)

        self.assertEqual(5, len(Observables([u, m])._get_namespaces()))
開發者ID:maurakilleen,項目名稱:crits_dependencies,代碼行數:11,代碼來源:email_message_test.py

示例2: main

# 需要導入模塊: from cybox.objects.email_message_object import EmailMessage [as 別名]
# 或者: from cybox.objects.email_message_object.EmailMessage import to [as 別名]
def main():
    NS = cybox.utils.Namespace("http://example.com/", "example")
    cybox.utils.set_id_namespace(NS)

    m = EmailMessage()
    m.to = ["[email protected]", "victi[email protected]"]
    m.from_ = "[email protected]"
    m.subject = "New modifications to the specification"

    a = Address("192.168.1.1", Address.CAT_IPV4)

    m.add_related(a, "Received_From", inline=False)

    print(Observables([m, a]).to_xml())
開發者ID:juandiana,項目名稱:python-cybox,代碼行數:16,代碼來源:simple_email_instance.py

示例3: test_get_namespaces

# 需要導入模塊: from cybox.objects.email_message_object import EmailMessage [as 別名]
# 或者: from cybox.objects.email_message_object.EmailMessage import to [as 別名]
    def test_get_namespaces(self):
        m = EmailMessage()
        m.to = "[email protected]"
        m.subject = "Here's a cool picture"
        m.links = Links()
        u = URI("http://example.com/cool.jpg", URI.TYPE_URL)
        m.links.append(u.parent.id_)

        o = Observables([u, m])
        logger.info(o.to_xml())
        actual_namespaces = o._get_namespaces()

        logger.info("\n".join([str(x) for x in actual_namespaces]))

        self.assertEqual(5, len(actual_namespaces))
開發者ID:juandiana,項目名稱:python-cybox,代碼行數:17,代碼來源:email_message_test.py

示例4: main

# 需要導入模塊: from cybox.objects.email_message_object import EmailMessage [as 別名]
# 或者: from cybox.objects.email_message_object.EmailMessage import to [as 別名]
def main():
    print '<?xml version="1.0" encoding="UTF-8"?>'

    attachment = File()
    attachment.file_name = "FooBar Specification (critical revision).doc"
    attachment.add_hash(Hash("4EC0027BEF4D7E1786A04D021FA8A67F"))

    email = EmailMessage()
    email.attachments.append(attachment)
    email.subject = String("New modifications to the specification")
    email.to = EmailRecipients(EmailAddress("[email protected]"),
                               EmailAddress("[email protected]"))
    email.from_ = EmailAddress("[email protected]")


    print Observables(email).to_xml()
開發者ID:2xyo,項目名稱:python-cybox,代碼行數:18,代碼來源:se_06.py

示例5: main

# 需要導入模塊: from cybox.objects.email_message_object import EmailMessage [as 別名]
# 或者: from cybox.objects.email_message_object.EmailMessage import to [as 別名]
def main():
    NS = cybox.utils.Namespace("http://example.com/", "example")
    cybox.utils.set_id_namespace(NS)

    # �I�u�W�F�N�g�̍쐬�iEmailMesage)
    m = EmailMessage()
    # �I�u�W�F�N�g�Ɋ֘A�t��
    m.to = ["[email protected]", "[email protected]"]
    m.from_ = "[email protected]"
    m.subject = "New modifications to the specification"

    # �I�u�W�F�N�g�̍쐬�iAdress)
    a = Address("192.168.1.1", Address.CAT_IPV4)

    # �I�u�W�F�N�g�Ԃ̊֘A
    m.add_related(a, "Received_From", inline=False)
    a.add_related(m, "Received_to", inline=False)

    print Observables([m, a]).to_xml()
開發者ID:geliefan,項目名稱:Python_mycode,代碼行數:21,代碼來源:simple_email_instance.py


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