Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 30363

Why does an email subject contain linefeed or carriage return characters?

$
0
0

I'm making a code to check a mailbox, and forward unseen mails to another user.
But sometimes it fails with an error:

ValueError: Header values may not contain linefeed or carriage return characters

I checked the raw fetched data and found out that the 'Subject' value contains \r\n.
Not all mails contain, but some do.
It just appears normal in the mailbox, and I have no idea why some contain such characters.
Does it have to do with the length of the subject?
How can I deal with these situations?
Thanks :)


Viewing all articles
Browse latest Browse all 30363

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>