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


Groups > comp.lang.python > #52223

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

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eweka.nl!lightspeed.eweka.nl!194.109.133.87.MISMATCH!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.038
X-Spam-Evidence '*H*': 0.93; '*S*': 0.00; 'subject:Python': 0.06; 'attachment.': 0.09; 'subject:files': 0.09; 'subject:script': 0.09; 'subject:How': 0.10; 'help!!!': 0.16; 'subject: \n ': 0.16; 'subject:send': 0.16; 'wrote:': 0.18; 'library': 0.18; 'thu,': 0.19; 'aug': 0.22; 'script.': 0.24; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'file': 0.32; 'figure': 0.32; 'stuff': 0.32; 'url:python': 0.33; 'received:google.com': 0.35; 'url:org': 0.36; 'should': 0.36; 'url:library': 0.38; 'to:addr :python-list': 0.38; 'files': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'url:3': 0.61; 'you.': 0.62; 'here': 0.66; 'repeat': 0.74; 'subject:get': 0.81; 'dilemma': 0.84; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=f52k7sx/IJUJSeNUX+xj4a/htu76YGCFDAOCzoYahSI=; b=tibjrp+lPLtMX5hLV5dZfGvE2I2TrmjwF9YCewM/X2H24QaEVAJ+aNj2aie3nacy/b FFHEw4kma19RhHu0sOlI/AP634mgm/BuG2n2fghffA4R1wEp3TLY/G/jeaiLZ77kOXLl wuAEjWCQCMnxVbRGeB455DdwvpC+EdEx4qBcyn1nlwXeb6Qr2OLEnD5H3jEAVaXnE2sO F25YRcyQDH1WqCk7bBztUNl8ZHhuM3LC9I3aAdB3P2/0DwYjO6qhety4wsLhCLJBRo4m jZJiJp/STcEa/xCoHFYR4GZFEkx1mi1/8wmrpz/Rw8CzYiKFncWTQcZtTi/jr0durzwS b4hA==
X-Received by 10.66.164.199 with SMTP id ys7mr7795600pab.104.1375990311802; Thu, 08 Aug 2013 12:31:51 -0700 (PDT)
MIME-Version 1.0
In-Reply-To <28e2b5ac-6dbf-4f90-a0f0-fc5cc33fc2ef@googlegroups.com>
References <28e2b5ac-6dbf-4f90-a0f0-fc5cc33fc2ef@googlegroups.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Thu, 8 Aug 2013 13:31:11 -0600
Subject Re: How Do I get my Python script to attach multiple files and send as a single email
To Python <python-list@python.org>
Content-Type text/plain; charset=ISO-8859-1
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.368.1375990315.1251.python-list@python.org> (permalink)
Lines 11
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1375990315 news.xs4all.nl 15999 [2001:888:2000:d::a6]:58199
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:52223

Show key headers only | View raw


On Thu, Aug 8, 2013 at 1: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.

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

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