[Tutor] Trouble with a Recipe ...

Vern Ceder vceder at canterburyschool.org
Tue Aug 25 15:55:35 CEST 2009


At the top in the docstring it says, '"To", "Cc" and "Bcc" values must 
be *lists*'.

That means instead of "To":  "garry.bettle at gmail.com", you need "To": 
["garry.bettle at gmail.com"] i.e. a list containing the destination 
address. That's so that you could send to, cc and bcc more than one address.

HTH,

Vern


Garry Bettle wrote:
> Hi,
> 
> Hope this email finds everyone well - roll on the weekend.
> 
> I'm trying to run http://code.activestate.com/recipes/576824/
> 
> I'm in IDLE and I try:
> 
>>>> email_it_via_gmail( {"To": "garry.bettle at gmail.com", "Subject": "Testing", "From": "garry.bettle at gmail.com"}, text="Testing")
> 
> but I get the following error:
> 
> Traceback (most recent call last):
>   File "<pyshell#17>", line 1, in <module>
>     email_it_via_gmail( {"To": "garry.bettle at gmail.com", "Subject":
> "Testing", "From": "garry.bettle at gmail.com"}, text="Testing")
>   File "C:\Documents and Settings\Garry\Desktop\recipe-576824-1.py",
> line 50, in email_it_via_gmail
>     + headers.get("Bcc", [])
> TypeError: cannot concatenate 'str' and 'list' objects
> 
> Sorry, but I according to the recipe I don't need a Bcc.
> 
> Sorry, again, for such a simple question!
> 
> Cheers,
> 
> Garry
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor

-- 
This time for sure!
    -Bullwinkle J. Moose
-----------------------------
Vern Ceder, Director of Technology
Canterbury School, 3210 Smith Road, Ft Wayne, IN 46804
vceder at canterburyschool.org; 260-436-0746; FAX: 260-436-5137


More information about the Tutor mailing list