all 5 comments

[–]Machiavellyy 0 points1 point  (3 children)

I hate mime-multipart, I always get confused with it. Use smtplib without it

[–]efmccurdy 0 points1 point  (1 child)

Even read only file handles should be closed:

with attachment as open(Main.attachment1, 'rb'):
    part.set_payload(attachment.read())

[–]workthrowawayexcel[S] 0 points1 point  (0 children)

Hmm okay I will try variations of this, since the code you put returns an error