Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 338bcbc commit b05df57Copy full SHA for b05df57
1 file changed
Doc/lib/emailmessage.tex
@@ -36,6 +36,20 @@
36
Return the entire message flatten as a string. When optional
37
\var{unixfrom} is \code{True}, the envelope header is included in the
38
returned string. \var{unixfrom} defaults to \code{False}.
39
+
40
+Note that this method is provided as a convenience and may not always
41
+format the message the way you want. For more flexibility,
42
+instantiate a \class{Generator} instance and use its
43
+\method{flatten()} method directly. For example:
44
45
+\begin{verbatim}
46
+from cStringIO import StringIO
47
+from email.Generator import Generator
48
+fp = StringIO()
49
+g = Generator(mangle_from_=False, maxheaderlen=60)
50
+g.flatten(msg)
51
+text = fp.getvalue()
52
+\end{verbatim}
53
\end{methoddesc}
54
55
\begin{methoddesc}[Message]{__str__}{}
0 commit comments