send email with bcc
Ervin Hegedüs
airween at gmail.com
Fri Nov 30 16:03:29 EST 2012
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
More information about the Python-list
mailing list