send email with bcc

Tim Golden mail at
Fri Nov 30 21:40:27 CET 2012

On 30/11/2012 20:25, Ed wrote:
> to = 'ed at'
> bcc = 'ed at'

[... 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:


ActivePython (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'
 >>> bcc = 'ed at'
 >>> [to] + bcc
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
TypeError: can only concatenate list (not "str") to list


which suggests, fairly clearly, that you're trying to concatenate a 
string and a list.


More information about the Python-list mailing list