PDA

View Full Version : LineFeed in CronTab Mail


Mike_Hunt
05-19-2005, 08:24 PM
Hi,

My cron php script process outputs some information, which I receive in an email. If I view the email using a web-based mail reader (QuestMail) everything is fine, but when I view the email in Outlook, there dosen't seem to be any carriage returns or line feeds. I have tried all sorts of ways to make a line feed (chr(10), \n, \x0A) but nothing seems to work. I am using echo to output the information.

Has anyone seen this before, or any ideas what is going on?

Thanks!

sheila
05-19-2005, 09:03 PM
Can you paste the full headers of one of these emails into a reply?

What platform are you on? (sounds like Windows, but never hurts to ask...)

What are your settings in Outlook as far as for viewing emails? View as plain text? View as HTML? or...other?

In some cases, I have done the following in Python to get good results (not sure if this will work in all languages):
Do a replace on all \r\n as \n
Then do a replace on all \r as \n
(this is sometimes necessary in HTML form data, as the characters sent may be specific to the platform being used). This corrects all line endings in the data on the server to just plain \n.

I know I had an issue with the mailform script I wrote that I made the above correction expressly for Outlook Express. Not sure if this would assist with your situation...but figured it was worth a mention.

Mike_Hunt
05-19-2005, 09:53 PM
Thanks Sheila!

Turns out that the \n was what I needed.

I actually had that in there as a test, but over-looked it in the big jumble of output I was getting.

BTW... I'm on Windows 2000 with Outlook 2000. When viewing these emails, I cannot change the format, and I assume it is in plain text.

Anyway, thanks for the help!