send email with bcc
Tim Golden
mail at timgolden.me.uk
Fri Nov 30 15:40:27 EST 2012
On 30/11/2012 20:25, Ed wrote:
> to = 'ed at domain.gov'
> bcc = 'ed at 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 at domain.gov'
>>> bcc = 'ed at 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
More information about the Python-list
mailing list