Path: csiph.com!usenet.pasdenom.info!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.029 X-Spam-Evidence: '*H*': 0.94; '*S*': 0.00; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'runs': 0.10; '>the': 0.16; 'line).': 0.16; 'message-id:@4ax.com': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'app': 0.19; 'module': 0.19; 'thu,': 0.19; 'url:home': 0.24; 'server.': 0.24; 'header:X -Complaints-To:1': 0.27; 'dec': 0.30; '-0700,': 0.31; 'initiate': 0.31; 'file': 0.32; 'url:python': 0.33; 'but': 0.35; 'smtp': 0.36; 'next': 0.36; 'charset:us-ascii': 0.36; 'url:org': 0.36; 'unit': 0.37; 'received:76': 0.38; 'server': 0.38; 'url:library': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'more': 0.64; 'day': 0.76; 'examples.': 0.84; 'shutdown': 0.84; 'subject:Using': 0.84; '2013': 0.98 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Dennis Lee Bieber Subject: Re: Using pythons smtp server Date: Fri, 13 Dec 2013 12:24:14 -0500 Organization: IISS Elusive Unicorn References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: adsl-76-249-30-188.dsl.klmzmi.sbcglobal.net X-Newsreader: Forte Agent 6.00/32.1186 X-No-Archive: YES 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: 22 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1386955493 news.xs4all.nl 2875 [2001:888:2000:d::a6]:32886 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:61849 On Thu, 12 Dec 2013 18:01:58 -0700, Vincent Davis declaimed the following: >I have an app that generates a file one a day and would like to email it >using pythons SMTP server. >http://docs.python.org/2/library/smtpd.html#smtpd.SMTPServer >The documentation is kinda sparse and I cant seem to find any good examples. > >Basically what I want to do; when my app runs it would initiate a SMTP >server, send the attachment and shutdown the SMTP after. > I suspect you don't want the "server" per se -- that's more a unit for receiving SMTP mail (sure, you can start it, but then you have to send the email to IT so it can relay it to the next server in the line). Look into the smtplib module (section 20.12 in the v2.7.2 documentation) in order to send email TO a mail server -- Wulfraed Dennis Lee Bieber AF6VN wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/