I am using Python3 and mime.multipart to send an attachment. I was able to send attachment successfully. But today, I get an error saying file does not exist, when I can see in WINSCP that it clearly does. Is this a permissions issue? Also when I list the contents of the directory, the file DOES NOT show up. What is going on?
I wasn't closing the stream after writing to the file. So the code couldn't find the file. However when the script finished, the stream would get closed by force and I would see the file in the folder.
Python cannot find file to send as email attachment