Here is a way you can do it; writes the text file and sends an email. The trickiest bit is getting it to work with your specific SMTP email server. If you have gmail it's easy as pie; if not - google around...
...
Let me know how you get on.
socket.error: [Errno 10061] No connection could be made because the target machine actively refused it
Malcolm,
Some googling revealed that your problem may be to do with a firewall -...
If you are using a workplace computer it may be that your workplace has some kind of firewall that is blocking your connection to gmail (but if you can access gmail from your workplace, this probably isn't the case)...
Stacy (and others),
Yes, it's a work computer related issue. I've tried this at home on my personal computer and it has worked perfectly. Now for the difficult bit - trying to get an answer from the work IT people!
Thanks again for your help and I'll be following your blog.
Mal