Your code is fine, ...
In addition to what Jason wrote, note that the way you need to authenticate to most email servers has changed substantially since this tutorial example was written. The OP has a yahoo.com email address. Even assuming you used something like smtp.yahoo.com as the SMTP server, it's unlikely you could just send mail through that host without some sort of authentication. Skip -- https://mail.python.org/mailman/listinfo/python-list