Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import praw
- import smtplib
- import string
- import time
- import datetime
- today = datetime.date.today()
- r=praw.Reddit(user_agent='DiaryOfEarth');
- r.login('USERNAME','PASSWORD')
- r.submit('DiaryOfEarth',today.strftime("%B %d, %Y"), text="Thread started by the DiaryOfEarth robot.\n\nShare your thoughts.");
- SUBJECT = "Diary of Earth, %s days in!" % today.strftime("%j")
- text = "Another successful job, thanks to automation.";
- BODY = string.join((
- "From: Diary of Earth Robot <[email protected]>",
- "To: Mr. Pheterson <[email protected]>",
- "Subject: %s" % SUBJECT ,
- "",
- text
- ), "\r\n")
- server = smtplib.SMTP("smtp.gmail.com", 587)
- server.ehlo()
- server.starttls()
- server.ehlo()
- server.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement