Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!newsreader4.netcologne.de!news.netcologne.de!xlned.com!feeder7.xlned.com!news2.euro.net!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.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'subject:Python': 0.05; '(python': 0.05; 'interpreted': 0.07; 'main()': 0.07; 'msg': 0.07; 'python': 0.09; '22,': 0.09; '__future__': 0.09; 'before.': 0.09; 'objects.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'terry': 0.09; 'psf': 0.15; 'fromaddr': 0.16; 'help...': 0.16; 'modules,': 0.16; 'newlines': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'reedy': 0.16; 'toaddrs': 0.16; 'wrote:': 0.17; 'headers': 0.17; 'module,': 0.17; 'jan': 0.18; 'module': 0.19; 'import': 0.21; '2.x': 0.22; '3.2': 0.22; '3.x': 0.22; 'arm': 0.22; 'doc': 0.22; 'example': 0.23; 'seems': 0.23; 'header': 0.24; 'linux': 0.24; 'header:In-Reply-To:1': 0.25; 'header:User-Agent:1': 0.26; 'am,': 0.27; 'separate': 0.27; 'header:X-Complaints-To:1': 0.28; 'run': 0.28; 'division': 0.29; 'far.': 0.29; 'installed,': 0.29; 'starts': 0.29; "i'm": 0.29; '(including': 0.30; 'usually': 0.30; 'december': 0.32; 'url:python': 0.32; 'message.': 0.33; 'says': 0.33; 'bought': 0.33; 'to:addr:python-list': 0.33; 'another': 0.33; 'smtp': 0.35; 'board': 0.35; 'pm,': 0.35; 'there': 0.35; 'received:org': 0.36; 'but': 0.36; 'url:org': 0.36; 'url:library': 0.36; 'method': 0.36; 'test': 0.36; 'should': 0.36; 'two': 0.37; 'subject:: ': 0.38; 'some': 0.38; 'things': 0.38; 'possible.': 0.38; 'url:docs': 0.38; 'sure': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'skip:" 10': 0.40; 'header:Received:5': 0.40; 'think': 0.40; 'your': 0.60; 'subject:, ': 0.61; 'note:': 0.64; 'become': 0.65; 'subject': 0.66; 'subject:,': 0.81; '2.7.': 0.84; 'received:fios.verizon.net': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Terry Reedy Subject: Re: Python, email temperature Date: Sun, 23 Dec 2012 19:31:32 -0500 References: <543ec063-14c1-4ca6-a911-ae6f58c22a8c@googlegroups.com> <50D73E0C.70709@lightbird.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: pool-173-75-251-66.phlapa.fios.verizon.net User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/17.0 Thunderbird/17.0 In-Reply-To: <50D73E0C.70709@lightbird.net> 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: 45 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1356309117 news.xs4all.nl 6915 [2001:888:2000:d::a6]:33134 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:35419 On 12/23/2012 12:23 PM, Mitya Sirenef wrote: > On 12/23/2012 08:46 AM, KarlE wrote: >> On Saturday, December 22, 2012 9:36:41 PM UTC+1, KarlE wrote: >> from __future__ import division Depending on the linux installed, you should be able to run 3.2 or 3.3 instead of 2.7. Though there are still 2.x only modules, some things work better in 3.x (including default division). >> server.sendmail(fromaddr, toaddrs, ord) >> server.quit() >> >> main() >> > I'm not sure if Raspberry Pi has it, but usually you want to > use the email module, as in example on this page: > > http://docs.python.org/2/library/email-examples.html#email-examples 3.2+ have a separate .send_message method for email message objects. > I think what happens is that because your message starts > with 'Subject:', it's interpreted as subject header instead of > an email. You can try adding two newlines after Subject:, > that might help... but using email module is best if possible. The 3.3 SMTP doc says that the fromaddr and toaddrs are only used by the transport layer and do not become part of the email message. The doc example has msg = ("From: %s\r\nTo: %s\r\n\r\n" % (fromaddr, ", ".join(toaddrs))) The body is appended after the double return. A subject line and any other standard headers would go before. OT note: the PSF (Python Software Foundation) has bought a Raspberry PI and another ARM board to test Python on. I am happy to read that it seems to be working so far. -- Terry Jan Reedy