[Tutor] Simple Question (I Hope)

2012-01-14 Thread Chris Kavanagh
I was looking at this code from the Python Docs (http://docs.python.org/library/email-examples.html), trying to learn how to send email from a Pyhton script. Anyways, part of this code confused me. Here's the script: 1 # Import smtplib for the actual sending function 2 import smtplib 3 4 #

Re: [Tutor] Simple Question (I Hope)

2012-01-14 Thread Alex Hall
On 1/14/12, Chris Kavanagh cka...@msn.com wrote: I was looking at this code from the Python Docs (http://docs.python.org/library/email-examples.html), trying to learn how to send email from a Pyhton script. Anyways, part of this code confused me. Here's the script: 1 # Import smtplib for the

Re: [Tutor] Simple Question (I Hope)

2012-01-14 Thread Steven D'Aprano
Chris Kavanagh wrote: 16 msg['Subject'] = 'The contents of %s' % textfile 17 msg['From'] = me 18 msg['To'] = you What I don't understand is lines 16-18, more specifically the msg['Subject'] format. I thought this was only done with dics?? Obviously the variable msg isn't a dic, so how can

Re: [Tutor] Simple Question (I Hope)

2012-01-14 Thread Modulok
On 1/14/12, Chris Kavanagh cka...@msn.com wrote: I was looking at this code from the Python Docs (http://docs.python.org/library/email-examples.html), trying to learn how to send email from a Pyhton script. Anyways, part of this code confused me. Here's the script: 1 # Import smtplib for the