Hi JP,
Thanks - No I made no changes to it. Just created a gmail account and followed the example exactly. I know it works because gmail emails me to tell me that it was blocked suspicious access.
Thomas - not sure if I follow 2-step authentication - its just an ordinary gmail account with username and password and I plug these into the python script provided in the example.
Thanks
Stev