Solved

php line spacing

Posted on 2013-12-03
4
498 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
  • 2
4 Comments
 
LVL 82

Accepted Solution

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

Expert Comment

by:Steven Harris
Comment Utility
Try using:  echo "\r\n"
0
 

Author Closing Comment

by:Richard Korts
Comment Utility
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 82

Expert Comment

by:Dave Baldwin
Comment Utility
You're welcome.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Suggested Solutions

Introduction Many web sites contain image galleries; a common design for these galleries includes a page with a collection of thumbnail images.  You can click on each of the thumbnail images to see the larger version of the image.  This is easily i…
Consider the following scenario: You are working on a website and make something great - something that lets the server work with information submitted by your users. This could be anything, from a simple guestbook to a e-Money solution. But what…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

743 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now