SMTPlib Emailing Attachments

Richie Hindle richie at entrian.com
Thu Sep 18 09:30:22 EDT 2003


[Bill]
> IOError: [Errno 2] No such file or directory: 'C:\\Email\test.txt'
                                                   ^^     ^

You've missed a backslash somewhere.  Your filename looks like
C:\Email<tab>est.txt.  You should always do one of the following:

 o Remember to double your backslashes: "C:\\Email\\test.txt"
 o Use raw strings for pathnames: r"C:\Email\test.txt"
 o Use forward slashes (which are fine on Windows): "C:/Email/test.txt"

-- 
Richie Hindle
richie at entrian.com






More information about the Python-list mailing list