Forum Moderators: coopster

Message Too Old, No Replies

How do you hack mail() to get around Outlook's removal of line breaks

         

smithaa02

9:49 pm on Sep 26, 2005 (gmt 0)

10+ Year Member



Outlook has a default setting that removes certain line breaks (\n) from text messages. This setting can be found under tools > options > email options > 'Remove Extra Line Breaks In Plain Text Documents' (for Outlook 2003).

This is problematic because I need WYSIWYG input areas for clients to set how their email will look. Microsoft really should have never violated the WYSIWYG rule for text email.

If you want to try this for yourself, use php mail() to mail yourself the following sample text :

$msg = "This is a sample sentence
---Sample sentence number 2
---Sample sentence number 3 Sept 2005 each
---Sample sentence number 4";

When I receive this email in outlook, the line break after ‘each’ is clipped making the email look like a mess (unless I uncheck line break setting in outlook).

Microsoft even talks about this bug here : url [support.microsoft.com]

Does anybody know of a way to send php text messages without encountering this issue. That or does anybody know the exact algorithm Microsoft uses to determine when and when not to clip new lines?

coopster

11:20 pm on Sep 26, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Send it in HTML format? ;)

I actually thought I was being funny until I read your MS link there and that actually was one of their suggested workarounds!

If it is an MS bug, I don't how you are going to circumvent the issue. Educating your user is probably the best bet. Either offer up a link in the email or on the page that is sending out the email that explains to MS Outlook users the *wonderful* feature and a link to the MS site explaining how to fix it.

smithaa02

1:59 pm on Sep 27, 2005 (gmt 0)

10+ Year Member



The strange thing is that I can't figure out when Outlook decides to strip \n from text emails... I was hoping if I could figure that out, I may be able to work around the issue.

I’m afraid having a separate page might be too much work for most lazy recipients of these emails…

Worst case scenario, one could use html emails... Unfortunately, html emails score points on most spam filters which I want to avoid.

It’s very frustrating to know that because Outlook is such a standard for email clients, dynamic text emails are virtually impossible, and static text emails must be painstakingly and time-consumingly tested to make sure you don’t get any formatting errors…

john_k

2:20 pm on Sep 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The idea for this brilliant feature must have come from a committee. I sure hope it finds its way out of any future versions of Outlook. I can only guess that they were trying fix emails that have been formatted for a maximum line width. You would think that they would have tested at least one email with some type of list in it.

Anyway, the only sure thing is that the algorithm will honor a double linebreak. Other than that it pretty much assumes that everything is part of the same paragraph and patches it up for you.

The best idea I can think of is that you create a short web page explaining the setting. (include instructions for disabling feature globally or just on an individual email). Then put a quick note near the top of the email. Something like this:

Attn Outlook Users: If plain text emails often appear jumbled, please check this note on how to fix your Outlook settings. <url goes here>