import smtplib, os, arcpy
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.MIMEText import MIMEText
from email import Encoders
# Fill in the necessary blanks here
gmail_user = sys.argv[1]
gmail_pwd = sys.argv[2]
# The parameters
to = sys.argv[3]
subject = sys.argv[4]
text = sys.argv[5]
def mail(to, subject, text):
msg = MIMEMultipart()
msg['From'] = gmail_user
msg['To'] = to
msg['Subject'] = subject
# Attaches a text message to the e-mail
msg.attach(MIMEText(text))
mailServer =smtplib.SMTP("smtp.gmail.com", 587)
mailServer.ehlo()
mailServer.starttls()
mailServer.ehlo()
mailServer.login(gmail_user, gmail_pwd)
mailServer.sendmail(gmail_user, to, msg.as_string())
mailServer.close()
mail(to, subject, text)
import smtplib, os, arcpy
from email.MIMEMultipart import MIMEMultipart
from email.MIMEBase import MIMEBase
from email.MIMEText import MIMEText
from email import Encoders
# Fill in the necessary blanks here
gmail_user = sys.argv[1]
gmail_pwd = sys.argv[2]
# The parameters
to = sys.argv[3]
subject = sys.argv[4]
text = sys.argv[5]
def mail(to, subject, text):
msg = MIMEMultipart()
msg['From'] = gmail_user
msg['To'] = to
msg['Subject'] = subject
# Attaches a text message to the e-mail
msg.attach(MIMEText(text))
mailServer =smtplib.SMTP("smtp.gmail.com", 587)
mailServer.ehlo()
mailServer.starttls()
mailServer.ehlo()
mailServer.login(gmail_user, gmail_pwd)
mailServer.sendmail(gmail_user, to, msg.as_string())
mailServer.close()
mail(to, subject, text)