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


Groups > comp.lang.python > #34109

Re: send email with bcc

Date 2012-11-30 20:40 +0000
From Tim Golden <mail@timgolden.me.uk>
Subject Re: send email with bcc
References <9fedf732-2a8e-4445-bdce-b88d53f4540c@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.393.1354308034.29569.python-list@python.org> (permalink)

Show all headers | 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