Created
January 25, 2017 22:04
-
-
Save DustinAlandzes/60b6e0c6423bb49d700f27ee3f5fcc90 to your computer and use it in GitHub Desktop.
This file contains 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
#!/usr/bin/env python3 | |
import smtplib | |
login = {"username":"", "password":""} | |
mailgun = {"server": "smtp.mailgun.org", "port": 587} | |
def send_message_via_smtp(sender, reciever, msg): | |
smtp = smtplib.SMTP(mailgun["server"], mailgun["port"]) | |
smtp.login(login["username"], login["password"]) | |
smtp.sendmail(sender, reciever, msg) | |
if __name__ == "__main__": | |
import sys | |
input = "" | |
for line in sys.stdin: | |
input += line | |
print("Message:") | |
print(input) | |
send_message_via_smtp("[email protected]", "[email protected]", input) | |
send_message_via_smtp("[email protected]", "[email protected]", input) | |
print("Sent to Dustin & John") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment