Solved

php line spacing

Posted on 2013-12-03
4
516 Views
Last Modified: 2013-12-03
See attached php scripts. The one with _prev is the previous one.

I have had a lot of issues with php mail function on this web server so I decided (at the recommendation of several EE Experts) to use a different class, class.phpmailer.php. I also attached it. I have successfully used it in another portion of this application.

In the script updt_test.php, it works fine & generates the email correctly; it just does NOT put line spacing after each line in the email body. Not that the previous version used "\n" at the end of line. I tried adding "\r\n" as in updt_test.php, still no line break.

The following is the sent email:

A new instant customer has been added to the on-line database as follows: Full Name: RK Associates Contact Name: Richard Korts Billing Address 1: 866 Chardonney Way Billing Address 2: Billing Address 3: Billing Address 4: City: Escondido State: CA Zip: 92029 Phone: 760-746-3263 FAX: 92029 Alt. Phone: 760-489-1780 Alt. Contact: E-Mail: richardkorts@gmail.com Major Intersecting: Source: Timer & Location:

I know I solved this problem YEARS ago but for some reason, it no longer works.

How can I make it work?
updt-test.php
updt-test-prev.php
class.phpmailer.php
0
Comment
Question by:Richard Korts
[X]
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
4 Comments
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39693309
"\r\n" works in plain text email.  <br> must be used in HTML email.
0
 
LVL 18

Expert Comment

by:Steven Harris
ID: 39693323
Try using:  echo "\r\n"
0
 

Author Closing Comment

by:Richard Korts
ID: 39693402
Yes, of course I knew that, I did not realize that the class defaulted to HTML (which is a GOOD thing).

That fixed it up perfectly.

Thanks
0
 
LVL 83

Expert Comment

by:Dave Baldwin
ID: 39693480
You're welcome.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

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

Password hashing is better than message digests or encryption, and you should be using it instead of message digests or encryption.  Find out why and how in this article, which supplements the original article on PHP Client Registration, Login, Logo…
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to count occurrences of each item in an array.

626 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