diff options
Diffstat (limited to 'Doc/includes')
-rw-r--r-- | Doc/includes/email-mime.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Doc/includes/email-mime.py b/Doc/includes/email-mime.py index c87db6a..34c6bdb 100644 --- a/Doc/includes/email-mime.py +++ b/Doc/includes/email-mime.py @@ -1,7 +1,7 @@ -# Import smtplib for the actual sending function +# Import smtplib for the actual sending function. import smtplib -# Here are the email package modules we'll need +# Here are the email package modules we'll need. from email.message import EmailMessage # Create the container email message. @@ -13,13 +13,13 @@ msg['From'] = me msg['To'] = ', '.join(family) msg.preamble = 'You will not see this in a MIME-aware mail reader.\n' -# Open the files in binary mode. Use imghdr to figure out the -# MIME subtype for each specific image. +# Open the files in binary mode. You can also omit the subtype +# if you want MIMEImage to guess it. for file in pngfiles: with open(file, 'rb') as fp: img_data = fp.read() msg.add_attachment(img_data, maintype='image', - subtype='jpeg') + subtype='png') # Send the email via our own SMTP server. with smtplib.SMTP('localhost') as s: |