# Import smtplib for the actual sending functionimportsmtplib# Here are the email package modules we'll needfromemail.mime.imageimportMIMEImagefromemail.mime.multipartimportMIMEMultipartCOMMASPACE=', '# Create the container (outer) email message.msg=MIMEMultipart()msg['Subject']='Our family reunion'# me == the sender's email address# family = the list of all recipients' email addressesmsg['From']=memsg['To']=COMMASPACE.join(family)msg.preamble='Our family reunion'# Assume we know that the image files are all in PNG formatforfileinpngfiles:# Open the files in binary mode. Let the MIMEImage class automatically# guess the specific image type.fp=open(file,'rb')img=MIMEImage(fp.read())fp.close()msg.attach(img)# Send the email via our own SMTP server.