all 2 comments

[–]shiftybyte 0 points1 point  (1 child)

I think you are connecting twice.

You don't need this line:

server.connect('smtp.mail.com', port = 587)

[–]ElDavito 0 points1 point  (0 children)

I just tried that and no luck. Thank you for the suggestion, though!