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


Groups > comp.lang.python > #34110

Re: send email with bcc

Date 2012-11-30 22:03 +0100
From Ervin Hegedüs <airween@gmail.com>
Subject Re: send email with bcc
References <9fedf732-2a8e-4445-bdce-b88d53f4540c@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.394.1354309583.29569.python-list@python.org> (permalink)

Show all headers | View raw


Hello,

On Fri, Nov 30, 2012 at 12:25:37PM -0800, Ed wrote:
> 
> # Send the email
> smtp.sendmail(sender, [to] + bcc, msg.as_string())
> 
> The above generates the following error:
> Traceback (most recent call last):
>   File "/opt/batch/ebtest/example4.py", line 46, in <module>
>     smtp.sendmail(sender, [to] + bcc, msg.as_string())

didn't you forgot to attach the reason of the error, I mean what
is the Exception type?

> Other iterations of the code have worked without error, but do not send mail to the BCC recipient.

you could't concatenate a list and a string at this way.

You can do that one of these:

l = ['foo']
s = 'bar'

l.append(s)

or

n = l+[s]


a.
 

-- 
I � UTF-8

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