How Do I get my Python script to attach multiple files and send as a single email

Ian Kelly ian.g.kelly at gmail.com
Thu Aug 8 15:31:11 EDT 2013


On Thu, Aug 8, 2013 at 1:05 PM,  <wachkama at gmail.com> wrote:
> I have a dilemma I cant figure out how to send multiple files as an attachment to my email using this script. I can only send a single file attachment . Help!!!  Here is my script.

You just need to repeat part3 for each attachment.  Also the content
type in part3 should be the content type of the attachment, not
multipart/mixed.

You might also want to take a look at the email package in the
standard library which will do a lot of this stuff for you.

http://docs.python.org/3/library/email.html



More information about the Python-list mailing list