'Return the entire formatted message as a string.
Optional `unixfrom\' when True, means include the Unix From_ envelope
header.
This overrides the default as_string() implementation to not mangle
lines that begin with \'From \'. See bug #13433 for details.'

def as_string(self, unixfrom=False):

    fp = six.StringIO()
    g = generator.Generator(fp, mangle_from_=False)
    if ((sys.version_info < (2, 6, 6)) and isinstance(self._payload, six.text_type)):
        self._payload = self._payload.encode(self._charset.output_charset)
    g.flatten(self, unixfrom=unixfrom)
    return fp.getvalue()
