File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,16 +48,18 @@ file on disk and pass it to the system ``sendmail`` program on a Unix system::
4848 >>> import email.policy
4949 >>> from subprocess import Popen, PIPE
5050 >>> with open('mymsg.txt', 'b') as f:
51- ... Msg = msg_from_binary_file(f, policy=email.policy.mbox)
51+ ... msg = msg_from_binary_file(f, policy=email.policy.mbox)
5252 >>> p = Popen(['sendmail', msg['To'][0].address], stdin=PIPE)
5353 >>> g = BytesGenerator(p.stdin, policy=email.policy.SMTP)
5454 >>> g.flatten(msg)
5555 >>> p.stdin.close()
5656 >>> rc = p.wait()
5757
58+ .. XXX email.policy.mbox/MBOX does not exist yet
59+
5860 Some email package methods accept a *policy * keyword argument, allowing the
5961policy to be overridden for that method. For example, the following code uses
60- the :meth: `email.message.Message.as_string ` method of the *msg * object from the
62+ the :meth: `~ email.message.Message.as_string ` method of the *msg * object from the
6163previous example and re-write it to a file using the native line separators for
6264the platform on which it is running::
6365
You can’t perform that action at this time.
0 commit comments