Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: Losing eol character using MIME::Lite

by Laurent_R (Canon)
on Dec 09, 2017 at 15:03 UTC ( [id://1205222]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Losing eol character using MIME::Lite
in thread Losing eol character using MIME::Lite

Yes, I have had the same problem with Outlook deciding to remove EOL characters. There may be an easier or better solution (and I would be interested to know), but we ended up specifying HTML content. And that works (even though the Outlook HTML renderer is not exactly the best).
  • Comment on Re^3: Losing eol character using MIME::Lite

Replies are listed 'Best First'.
Re^4: Losing eol character using MIME::Lite
by afoken (Chancellor) on Dec 09, 2017 at 18:45 UTC

    Just a guess: As far as I remember, network line endings should generally be CR+LF. (See, for example, RFC5322.) When using "\n" on Unix, this generates just the LF, not CR+LF (unless MIME::Lite replaces "\n" with CR+LF). So Outlook may actually behave correct according to the letters of the RFC in refusing to accept anything but CR+LF as a line break. Yes, it's stupid, and I would expect nothing else from Outlook.

    Try replacing "\n" with "\r\n" in the message body.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
      Thank you, afoken, it was quite long ago, but I am almost sure that I did try both LF and CR+LF (at $work, we very often have to deal with EOL differences between *nix and Windows). The strange thing is that Outlook removes some line endings but not all of them and I wasn't able to find out the underlying rule leading to that. Also, it seems that Outlook does that not only for mails prepared with Perl under *nix boxes, but even for message written on Windows platforms with an Outlook client.

      Since determining that Outlook was the problem, I've tried several things to get it to display correctly, including adding a "\r" and trying different Mime types, to no avail. Oddly, changing the contents of the string that displays directly before the timestamp sometimes causes the "\n" to display.

      Further, I've tried different email address with different clients, and from the statistically insignificant number of clients I happen to have installed on this machine, it seems to be exclusively an Outlook issue.

      Thank you to everyone who took the time to look at this.

      Thanks,
      cbeckley

        I had a bunch of problems with this myself with plain text e-mails from Linux systems (just text files shoved out using /bin/mail). I did bunches of translation and tried every line ending I could to get what I wanted. I think I eventually stumbled across Line breaks are removed in posts made in plain text format in Outlook. I don't know if that will help (especially since you are using MIME e-mails), but it's worth a look.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1205222]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (4)
As of 2024-04-19 12:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found