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


Groups > comp.lang.python > #34109

Re: send email with bcc

Path csiph.com!usenet.pasdenom.info!aioe.org!news.newsland.it!newsfeed.x-privat.org!news2.euro.net!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <mail@timgolden.me.uk>
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; 'win32': 0.03; 'python': 0.09; 'typeerror:': 0.09; 'cc:addr:python-list': 0.10; '...]': 0.16; '2.7.2': 0.16; 'concatenate': 0.16; 'from:addr:timgolden.me.uk': 0.16; 'from:name:tim golden': 0.16; 'inc.)': 0.16; 'message-id:@timgolden.me.uk': 0.16; 'received:74.55.86': 0.16; 'received:74.55.86.74': 0.16; 'received:smtp.webfaction.com': 0.16; 'received:webfaction.com': 0.16; 'subject:send': 0.16; 'tjg': 0.16; 'traceback.': 0.16; 'string': 0.17; 'wrote:': 0.17; '>>>': 0.18; '(not': 0.20; 'trying': 0.21; 'bit': 0.21; 'fairly': 0.21; '"",': 0.22; 'cc:2**0': 0.23; 'this:': 0.23; 'cc:no real name:2**0': 0.24; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; '(most': 0.27; 'rest': 0.28; 'file': 0.32; 'traceback': 0.33; 'list': 0.35; 'received:192.168.0': 0.35; 'something': 0.35; 'list.': 0.35; 'but': 0.36; 'subject:with': 0.36; 'subject:: ': 0.38; 'received:192': 0.39; 'received:192.168': 0.40; 'more': 0.63; 'show': 0.63; 'from:addr:mail': 0.71; 'bcc': 0.84; 'received:192.168.0.5': 0.91; 'to:none': 0.93; 'imagine': 0.96
Date Fri, 30 Nov 2012 20:40:27 +0000
From Tim Golden <mail@timgolden.me.uk>
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:17.0) Gecko/17.0 Thunderbird/17.0
MIME-Version 1.0
CC python-list@python.org
Subject Re: send email with bcc
References <9fedf732-2a8e-4445-bdce-b88d53f4540c@googlegroups.com>
In-Reply-To <9fedf732-2a8e-4445-bdce-b88d53f4540c@googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
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.393.1354308034.29569.python-list@python.org> (permalink)
Lines 31
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1354308034 news.xs4all.nl 6844 [2001:888:2000:d::a6]:40195
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:34109

Show key headers only | View raw


On 30/11/2012 20:25, Ed wrote:
> to = 'ed@domain.gov'
> bcc = 'ed@domain.net'

[... snippage ...]

> smtp.sendmail(sender, [to] + bcc, msg.as_string())

Well, you crucially don't show us the rest of the traceback. But I 
imagine you'd have got something like this:

<dump>

ActivePython 2.7.2.5 (ActiveState Software Inc.) based on
Python 2.7.2 (default, Jun 24 2011, 12:21:10) [MSC v.1500 32 bit 
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
 >>> to = 'ed@domain.gov'
 >>> bcc = 'ed@domain.net'
 >>> [to] + bcc
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
TypeError: can only concatenate list (not "str") to list
 >>>

</dump>

which suggests, fairly clearly, that you're trying to concatenate a 
string and a list.

TJG

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

send email with bcc Ed <akegb3@gmail.com> - 2012-11-30 12:25 -0800
  Re: send email with bcc Tim Golden <mail@timgolden.me.uk> - 2012-11-30 20:40 +0000
  Re: send email with bcc Ervin Hegedüs <airween@gmail.com> - 2012-11-30 22:03 +0100
  Re: send email with bcc Ed <akegb3@gmail.com> - 2012-11-30 14:35 -0800
  Re: send email with bcc Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2012-12-01 14:41 -0500

csiph-web