473,401 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

mail() to Outlook, no carriage returns

I'm sending normal text email, but in Outlook all the carriage returns
are ignored. The text comes from MySQL database, and I've tried

str_replace("\r", "\r\n", $dr['email_template']);

I also tried sending header Content-type: text/plain but still no luck,
still the email comes through as one big line.

I'm sure this must be a common thing but I can't immediately find an
answer through Google.

Please can anyone help?

I'm using the standard mail() command to send.
Jun 14 '07 #1
3 3359
Tyno Gendo wrote:
I'm sending normal text email, but in Outlook all the carriage returns
are ignored. The text comes from MySQL database, and I've tried

str_replace("\r", "\r\n", $dr['email_template']);

I also tried sending header Content-type: text/plain but still no luck,
still the email comes through as one big line.

I'm sure this must be a common thing but I can't immediately find an
answer through Google.

Please can anyone help?

I'm using the standard mail() command to send.
Sorry, I meant str_replace( "\n", "\r\n", $dr['email_template']);

Doesn't work.
Jun 14 '07 #2
Tyno Gendo wrote:
I'm sending normal text email, but in Outlook all the carriage returns
are ignored. The text comes from MySQL database, and I've tried

str_replace("\r", "\r\n", $dr['email_template']);

I also tried sending header Content-type: text/plain but still no luck,
still the email comes through as one big line.

I'm sure this must be a common thing but I can't immediately find an
answer through Google.

Please can anyone help?

I'm using the standard mail() command to send.
Sorry all, me do bad. The replace does work, would help if I did it
in the correct place in my code, I'd replaced at the wrong point.

DOH!
Jun 14 '07 #3
Tyno Gendo wrote:
Tyno Gendo wrote:
>I'm sending normal text email, but in Outlook all the carriage returns
are ignored. The text comes from MySQL database, and I've tried

str_replace("\r", "\r\n", $dr['email_template']);

I also tried sending header Content-type: text/plain but still no luck,
still the email comes through as one big line.

I'm sure this must be a common thing but I can't immediately find an
answer through Google.

Please can anyone help?

I'm using the standard mail() command to send.

Sorry all, me do bad. The replace does work, would help if I did it
in the correct place in my code, I'd replaced at the wrong point.

DOH!
Glad to be of service. ;-)

Regards,
Erwin Moller
Jun 14 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Guy Verville | last post by:
I'm perplexed, I have several forms that seem to be ok, but what is sent by email doesn't contain all the Carriage returns sent. The form contains many fields and is sent as follow:...
4
by: Les Juby | last post by:
Can someone please help with a suggestion as to how I can keep the formatting (carriage returns) that the user enters into a memo field and then display that later. I figured I might be able to...
12
by: Nimmy | last post by:
Hi, I have a data file and I want to remove Carriage returns. Any one has any C code/program which does this? I am working on Windows XP machine.....I don't have access to UNIX machine. But I...
6
by: Lewis Edward Moten III | last post by:
I'm having some problems when debugging datasets in C#. During run-time, I arrive at a break point in my code and goto the command window. I type MyDataset.GetXML() The results are a lot of...
2
by: Matt Mercer | last post by:
Hi all, I am having a frustration problem, and I have read about 25 newsgroup postings that do not have a satisfying answer :) The problem appears to be common where carriage returns are lost...
8
by: TheDude5B | last post by:
Hi, I have some data which is stored in my MySQL database as TEXT. when the data is entered in, it has some carriage returns in it, and this can be seen when querying the data using MySQL Query...
7
by: mattrapoport | last post by:
I have a page with a div on it. The div displays a user comment. When the user logs into this page, their current comment is pulled from a db and displayed in the div. The user can edit the...
2
by: GregBeagle | last post by:
Windows XP I have a simple form from which I want to generate an email with the contents of the form. I use carriage returns to format the content for readability. When I test it on my computer...
0
by: markus.shure | last post by:
Hi, I'm noticed a problem testing a JAX-WS client with a WSE server. The JAX-WS client adds carriage returns to a SOAP header element that is signed. This causes the WSE server to raise an...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.