How to get line breaks in e-mail sent using Python's smtplib?

前端 未结 5 1733
说谎
说谎 2020-12-01 15:36

I have written a script that writes a message to a text file and also sends it as an email. Everything goes well, except the email finally appears to be all in one line.

5条回答
  •  不知归路
    2020-12-01 16:24

    Setting the content-type header to Content-Type: text/plain (with \r\n at the end) allowed me to send multi-line plain-text emails.

提交回复
热议问题