Пример #1
0
 def getMessagePayload(self,part):
     fp = StringIO.StringIO()
     g = EmailGenerator(fp, mangle_from_=False)
     g.flatten(part, unixfrom=False)
     return fp.getvalue()
Пример #2
0
    def mime_to_string(mime, header_len=0):
        fp = StringIO()
        g = MIMEGenerator(fp, mangle_from_=False, maxheaderlen=header_len)
        g.flatten(mime)

        return fp.getvalue()