Ejemplo n.º 1
0
    def test_plain(self):
        address_mime = appier.email_mime("João Magalhães <*****@*****.**>")

        mime = appier.plain("Hello World")
        mime["Subject"] = "Hello World"
        mime["From"] = address_mime
        mime["To"] = ", ".join([address_mime])

        result = mime.as_string()
        self.assertEqual(result, "Content-Type: text/plain; charset=\"utf-8\"\n\
MIME-Version: 1.0\n\
Content-Transfer-Encoding: base64\n\
Subject: Hello World\n\
From: =?utf-8?q?Jo=C3=A3o_Magalh=C3=A3es?= <*****@*****.**>\n\
To: =?utf-8?q?Jo=C3=A3o_Magalh=C3=A3es?= <*****@*****.**>\n\
\n\
SGVsbG8gV29ybGQ=\n")
Ejemplo n.º 2
0
    def test_plain(self):
        address_mime = appier.email_mime("João Magalhães <*****@*****.**>")

        mime = appier.plain("Hello World")
        mime["Subject"] = "Hello World"
        mime["From"] = address_mime
        mime["To"] = ", ".join([address_mime])

        result = mime.as_string()
        self.assertEqual(result, "Content-Type: text/plain; charset=\"utf-8\"\n\
MIME-Version: 1.0\n\
Content-Transfer-Encoding: base64\n\
Subject: Hello World\n\
From: =?utf-8?q?Jo=C3=A3o_Magalh=C3=A3es?= <*****@*****.**>\n\
To: =?utf-8?q?Jo=C3=A3o_Magalh=C3=A3es?= <*****@*****.**>\n\
\n\
SGVsbG8gV29ybGQ=\n")