Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'example:': 0.03; 'resulting': 0.04; 'subject:Python': 0.06; 'subject:files': 0.09; 'subject:script': 0.09; 'subject:How': 0.10; 'cc:addr:python- list': 0.11; 'python': 0.11; '"python': 0.16; 'at.': 0.16; 'help!!!': 0.16; 'parts,': 0.16; 'reasonably': 0.16; 'search:': 0.16; 'subject: \n ': 0.16; 'subject:send': 0.16; 'files.': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'module': 0.19; 'result.': 0.19; 'thu,': 0.19; 'aug': 0.22; 'cc:addr:python.org': 0.22; 'script.': 0.24; 'cc:2**0': 0.24; 'second': 0.26; 'header:In-Reply-To:1': 0.27; 'needed.': 0.30; 'especially': 0.30; 'message- id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'easier': 0.31; 'gary': 0.31; 'txt': 0.31; 'file': 0.32; 'figure': 0.32; 'url:python': 0.33; 'but': 0.35; 'received:google.com': 0.35; 'google': 0.35; 'there': 0.35; 'smtp': 0.36; 'url:listinfo': 0.36; 'url:org': 0.36; 'should': 0.36; 'files': 0.38; 'pm,': 0.38; 'url:mail': 0.40; 'how': 0.40; 'easy': 0.60; 'email addr:gmail.com': 0.63; 'here': 0.66; 'friend': 0.79; 'subject:get': 0.81; 'complex,': 0.84; 'dilemma': 0.84; 'joel': 0.91; '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:date:message-id:subject:from:to :cc:content-type; bh=WWV4stXSWZHMLrkqiP8PUScWrEhyAW26374ILTjqLUs=; b=rB0cvOdmjkNkntHOdPlaPZa2Rketc2ECVOquxvMtuopkbAM+dCQy+YumVi+p6drArQ hOk4dX8vcM6gnqA39IJ+GwE7OBNOSVfI0SSpeMCwDcHvVECyzUgdOt+t0kZgwkbpy6A2 OT2zwqx+0RqmpyCrBs/7FvPNfL705gVmO8XxV/TLuyPHGI+qvoh/bNMd9yCG2qrJ0Fdo YfItl46KJprAfb1rUtipOXLornTzeeWyXuXTeiFI5NaEOjq6Xm1GwVdG0pKGOoUwikHT 508H/YJxf6Af4sCT8PWL+XEle4FMnbsXv3+/jLBGHUy1N9mKM/fzY/+eXSZQ53JGfgjj oNiw== MIME-Version: 1.0 X-Received: by 10.220.104.74 with SMTP id n10mr4912692vco.74.1375990348987; Thu, 08 Aug 2013 12:32:28 -0700 (PDT) In-Reply-To: <5203EF4F.7020603@islandtraining.com> References: <28e2b5ac-6dbf-4f90-a0f0-fc5cc33fc2ef@googlegroups.com> <5203EF4F.7020603@islandtraining.com> Date: Thu, 8 Aug 2013 15:32:28 -0400 Subject: Re: How Do I get my Python script to attach multiple files and send as a single email From: Joel Goldstick To: Gary Herron Content-Type: text/plain; charset=UTF-8 Cc: "python-list@python.org" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1375990667 news.xs4all.nl 16010 [2001:888:2000:d::a6]:36234 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52224 On Thu, Aug 8, 2013 at 3:19 PM, Gary Herron wrote: > 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 > > -- > http://mail.python.org/mailman/listinfo/python-list Here is a good example: http://stackoverflow.com/questions/3362600/how-to-send-email-attachments-with-python I found it using the following google search: "python send email using smtp with multiple attachment" It was the second result. Google is your friend ;) -- Joel Goldstick http://joelgoldstick.com