By default the smtplib.SMTP objects did not have a sock attribute, it was only created during connect()
Attach a file by drag & drop or click to upload