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

That means instead of "To": "garry.bet...@gmail.com", you need "To": ["garry.bet...@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.bet...@gmail.com", "Subject": "Testing", "From": 
"garry.bet...@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.bet...@gmail.com", "Subject":
"Testing", "From": "garry.bet...@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@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
vce...@canterburyschool.org; 260-436-0746; FAX: 260-436-5137
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to