#!/usr/bin/pythonfrom email.MIMEMultipart import MIMEMultipartimport osimport sysfilename = sys.argv[1]msg = MIMEMultipart()msg['From'] = 'Me <me@example.com>'msg['To'] = 'You <you@example.com>'msg['Subject'] = 'Your picture'from email.MIMEText import MIMETexttext = MIMEText("Here's that picture I took of you.")msg.attach(text)from email.MIMEImage import MIMEImageimage = MIMEImage(open(filename).read(), name=os.path.split(filename)[1])msg.attach(image)
Name (required)
email (will not be published) (required)
Website