Solved

php line spacing

Posted on 2013-12-03
4
501 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 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mysqli 3 22
Making register page log you in after registration is complete. 2 14
WP_Query multiple custom taxonomies 5 28
How to convert my query to the proper format? 5 19
Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
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 dynamically set the form action using jQuery.

867 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

21 Experts available now in Live!

Get 1:1 Help Now