Created
January 20, 2015 08:38
-
-
Save SergSlon/0d7efec43fffc97948c1 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from email.mime.text import MIMEText | |
| from subprocess import Popen, PIPE | |
| msg = MIMEText("Here is the body of my message") | |
| msg["From"] = "me@example.com" | |
| msg["To"] = "you@example.com" | |
| msg["Subject"] = "This is the subject." | |
| p = Popen(["/usr/sbin/sendmail", "-t"], stdin=PIPE) | |
| p.communicate(msg.as_string()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment