send email with bcc

Ervin Hegedüs airween at
Fri Nov 30 22:03:29 CET 2012


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/", 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'



n = l+[s]


I � UTF-8

More information about the Python-list mailing list