Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.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.008 X-Spam-Evidence: '*H*': 0.98; '*S*': 0.00; 'python.': 0.02; 'that?': 0.05; 'subject:two': 0.07; 'bash': 0.09; 'subject:Why': 0.09; '12:59': 0.16; 'headers,': 0.16; 'headers.': 0.16; 'subject:sending': 0.16; 'supplied': 0.16; 'wrote:': 0.18; "aren't": 0.24; 'instance,': 0.24; 'mon,': 0.24; 'script': 0.25; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'included': 0.31; 'url:python': 0.33; 'at:': 0.34; 'subject:from': 0.34; 'message.': 0.35; 'subject:with': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'smtp': 0.36; 'url:org': 0.36; 'two': 0.37; 'server': 0.38; 'url:library': 0.38; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'to:addr:python.org': 0.39; 'recipients': 0.61; '2015': 0.84; 'bcc': 0.84; 'subject:times': 0.84 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=owfFLByvrCCYfpZuynIgveaW3S899gEtvOJGjEVLWEQ=; b=PTQuvpUrXR9B4Nvk3SY9zih9oQIgxrzH53QgPf/TSTTu4jzkx1YHpbyi+zadP8lt58 ttBxqMXmqGZBkLCdvLFIeojl9HCK1Jj99KHZTp6ySmW508lRWkuFaC2O0hhFIdQPdfuQ mSgVjHSgE+85GTFf0bKe0C0dTn6jlDir+8Sep0J1hcift7ZYRbevc34uq4c3vTxseDOJ kiBcFQjNs9GNT9Qz9mjk6kEs4LWH/wcew9Pb9rgi2tTYcxVY4VK8JNVD+BK8G7JqMmIk TW2dV5FhhQ+dAIJKJhTPm9Ge93x3/e1rRvu+VEKQJAXvdjoO0pg4quryi6bMWAw5ja2B tnAQ== X-Received: by 10.107.12.158 with SMTP id 30mr15677375iom.61.1430768963214; Mon, 04 May 2015 12:49:23 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <87ioc8i2y2.fsf@Equus.decebal.nl> References: <87ioc8i2y2.fsf@Equus.decebal.nl> From: Ian Kelly Date: Mon, 4 May 2015 13:48:42 -0600 Subject: Re: Why from en to two times with sending email To: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ 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: 10 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1430768965 news.xs4all.nl 2859 [2001:888:2000:d::a6]:47093 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:89928 On Mon, May 4, 2015 at 12:59 PM, Cecil Westerhof wrote: > I want to change an old Bash script to Python. When I look at: > https://docs.python.org/2/library/email-examples.html > > Then from and to have to be used two times? Why is that? Once to construct the message headers, and once to instruct the SMTP server where to send the message. These are not required to agree; for instance, bcc recipients need to be supplied to the server but aren't included in the headers.