# Import smtplib for the actual sending function
# Here are the email pacakge modules we'll need
from email.MIMEImage import MIMEImage
from email.MIMEMultipart import MIMEMultipart
# Create the container (outer) email message.
msg['Subject'] = 'Our family reunion'
# me == the sender's email address
# family = the list of all recipients' email addresses
msg['To'] = COMMASPACE.join(family)
msg.preamble = 'Our family reunion'
# Guarantees the message ends in a newline
# Assume we know that the image files are all in PNG format
# Open the files in binary mode. Let the MIMEImage class automatically
# guess the specific image type.
img = MIMEImage(fp.read())
# Send the email via our own SMTP server.
s.sendmail(me, family, msg.as_string())