Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


mailing in php?

Posted on 1999-07-10
Medium Priority
Last Modified: 2010-04-15
This is here since there is no php section.

I am using the mail function.  In the "message" section, I entered text, being very careful that it was formatted correctly.  However, once mailed, I end up with line breaks in the text in strange places, apparently random.  Sometimes there will be one word and then a line break in a sentance, sometimes 6 or 7 words and then a break.

Any idea what would might be causing this?


Question by:ChrisAndrews
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2

Expert Comment

ID: 1263482
Have you tried forcing the breaks in predictable places?

Just to see what will happen.

Author Comment

ID: 1263483

Yes, by using \n

and by just putting a line break using the 'enter' key in the text.  Is that what you mean?

Both of these worked to cause a line break, but the unwanted line break still appears.

Just to test it, I deleted the space between the words where one unwanted line bread was.  When I did that, the unwanted line break still occurred, just one word over to the left from where it was.  Odd.

Author Comment

ID: 1263484

Oh, just figured it out.

I edited the php script in a text editor and then pasted it onto a web page in my html editor.  

I think my html editor (HoTMetaL) forced some line breaks in the text.   arrrrgggghhh.

Didn't show up as line breaks when I first pasted it in for some reason, but when I had closed it and then reopened it later the breaks are there, in the same places as the unwanted breaks appear in the email, how 'bout that.

I think I am going to give up on html editors, since I have been using more php and javascript the editors have been causing lots of problems like this.

Thank you for your response though,


Accepted Solution

EatEmAndSmile earned 40 total points
ID: 1263485
I've got an important tip for you. Now that you realized html editors cause undesired errors on scripts, I'd suggest you to do something I've been doing for a while. What I do is separate the HTML pages from the PHP3 pages... For example, an upload file form would be an HTML page with a form on it. The form will pass data to a PHP3 page. But this PHP3 page isn't the page shown. Actually it proccess what it must do and then a 'Header ("Location: otherpage.html");' will redirect the browser to the page that should be shown if the upload was succesful or if it was unsuccesful or if a field was blank, or if the file was too big, etc...


Eat`Em And Smile!

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode ( They will have you believe that Unicode requires you to use…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question