fork(1) download
  1. from email.message import EmailMessage
  2. from email.headerregistry import Address
  3.  
  4. msg = EmailMessage()
  5.  
  6. msg['From'] = Address("Pepé Le Pew", "pepe", "example.com")
  7. msg['To'] = (
  8. Address("Penelope Pussycat", "penelope", "example.com")
  9. , Address("Fabrette Pussycat", "fabrette", "example.com")
  10. )
  11. msg['Subject'] = 'This email sent from Python code'
  12. msg.set_content("""\
  13. Salut!
  14.  
  15. Cela ressemble à un excellent recipie[1] déjeuner.
  16.  
  17. [1] http://w...content-available-to-author-only...y.com/recipe/Roasted-Asparagus-Epicurious-203718
  18.  
  19. --Pepé
  20. """, cte="quoted-printable")
  21. print(msg.as_string())
  22.  
Success #stdin #stdout 0.06s 18616KB
stdin
Standard input is empty
stdout
From: =?utf-8?q?Pep=C3=A9?= Le Pew <pepe@example.com>
To: Penelope Pussycat <penelope@example.com>,
 Fabrette Pussycat <fabrette@example.com>
Subject: This email sent from Python code
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0

        Salut!

        Cela ressemble =C3=A0 un excellent recipie[1] d=C3=A9jeuner.

        [1] http://w...content-available-to-author-only...y.com/recipe/Roasted-Asparagus-Epicurious-203718

        --Pep=C3=A9
       =20