Created
April 26, 2013 19:44
-
-
Save btobolaski/5469841 to your computer and use it in GitHub Desktop.
Adds a list of tasks from Drafts into your OmniFocus Inbox using Pythonista and Mail Drop
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
import re | |
import smtplib | |
import webbrowser | |
from email.mime.base import MIMEBase | |
from email.mime.multipart import MIMEMultipart | |
from email import encoders | |
########################### | |
to = '' | |
gmail_user = '' | |
gmail_password = '' | |
########################### | |
tasks = re.split("\n", sys.argv[1]) | |
smtpserver = smtplib.SMTP('smtp.gmail.com', 587) | |
smtpserver.ehlo() | |
smtpserver.starttls() | |
smtpserver.ehlo | |
smtpserver.login( gmail_user, gmail_password ) | |
for task in tasks: | |
outer = MIMEMultipart() | |
outer['Subject']=task | |
outer['to']=to | |
outer['From']=gmail_user | |
outer.preamble='You will not see this in a MIME-aware email reader.\n' | |
composed = outer.as_string() | |
smtpserver.sendmail(gmail_user, to, composed) | |
smtpserver.close() | |
webbrowser.open('drafts://') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment