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

Path csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <gary.herron@islandtraining.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'resulting': 0.04; 'subject:Python': 0.06; 'received:67.192': 0.09; 'received:67.192.241': 0.09; 'received:dfw.emailsrvr.com': 0.09; 'subject:files': 0.09; 'subject:script': 0.09; 'subject:How': 0.10; 'python': 0.11; 'at.': 0.16; 'help!!!': 0.16; 'parts,': 0.16; 'reasonably': 0.16; 'subject: \n ': 0.16; 'subject:send': 0.16; 'files.': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'module': 0.19; 'header:User-Agent:1': 0.23; 'received:emailsrvr.com': 0.24; 'script.': 0.24; 'received:(smtp server)': 0.26; 'header:In-Reply- To:1': 0.27; 'needed.': 0.30; 'especially': 0.30; 'easier': 0.31; 'gary': 0.31; 'txt': 0.31; 'file': 0.32; 'figure': 0.32; 'but': 0.35; 'there': 0.35; 'should': 0.36; 'to:addr:python-list': 0.38; 'files': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'easy': 0.60; 'email addr:gmail.com': 0.63; 'here': 0.66; 'subject:get': 0.81; 'complex,': 0.84; 'dilemma': 0.84
X-Virus-Scanned OK
Date Thu, 08 Aug 2013 12:19:43 -0700
From Gary Herron <gary.herron@islandtraining.com>
User-Agent Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130623 Thunderbird/17.0.7
MIME-Version 1.0
To python-list@python.org
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>
In-Reply-To <28e2b5ac-6dbf-4f90-a0f0-fc5cc33fc2ef@googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.366.1375990131.1251.python-list@python.org> (permalink)
Lines 16
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1375990131 news.xs4all.nl 15930 [2001:888:2000:d::a6]:54267
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:52220

Show key headers only | 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