Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #52220

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

Date 2013-08-08 12:19 -0700
From Gary Herron <gary.herron@islandtraining.com>
Subject Re: How Do I get my Python script to attach multiple files and send as a single email
References <28e2b5ac-6dbf-4f90-a0f0-fc5cc33fc2ef@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.366.1375990131.1251.python-list@python.org> (permalink)

Show all headers | View raw


On 08/08/2013 12:05 PM, wachkama@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.
> All filename's are txt files.
>
>
>

There is a standard Python module named "email" which you should look 
at.   It can build an email with all the parts, alternates, and 
attachments you want.  Then you send the resulting message using your 
smtplib code.  The email module is large and complex, but reasonably 
easy to learn (following the documentation examples). It's far, FAR, 
easier than rolling your message, especially when attachments are needed.

Gary Herron

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

How Do I get my Python script to attach multiple files and send as a single email wachkama@gmail.com - 2013-08-08 12:05 -0700
  Re: How Do I get my Python script to attach multiple files and send as a single email Gary Herron <gary.herron@islandtraining.com> - 2013-08-08 12:19 -0700
  Re: How Do I get my Python script to attach multiple files and send as a single email Ian Kelly <ian.g.kelly@gmail.com> - 2013-08-08 13:31 -0600
  Re: How Do I get my Python script to attach multiple files and send as a single email Joel Goldstick <joel.goldstick@gmail.com> - 2013-08-08 15:32 -0400

csiph-web