Skip to content
Discussion options

You must be logged in to vote

The RFCs (see e.g. wikipedia on SMTP) states that all lines need to end with CRLF ("\r\n" in python).
This might be handled by the umail package, but who knows without looking ?

I think the real error here is that you don't separate the mail headers from the content.
In SMTP needs to be an empty line after you send the content-type, e.g.

smtp.write('Content-Disposition: attachment; filename=sensor.csv\r\n')
smtp.write('\r\n')
with open('sensor.csv', 'r') as infile:
    content=infile.read()

My guess: everything in front of the colon : gets interpreted as some (unknown) header when you don't tell the package that the mail headers are complete.

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@robertgall
Comment options

Answer selected by robertgall
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants