PHP contact form styling (line spacing)

Status
Not open for further replies.
Messages
740
Reaction score
1
Points
18
Hey

I've got my contact form set up - works all nice.

I just want to customize it a litter further though.

When the user submits the form, it emails me whatever they've said.

PHP:
    $subject = "UltraWay.net Email";
    
    $message = "You've received an e-mail through your website mail form: \n";
  
    $message .= "Name: {$_POST['name']} \n";
    $message .= "E-mail: {$_POST['email']} \n";
    $message .= "Country: {$_POST['country']} \n";
   
    $message .= "Feedback: {$_POST['comments']} \n";

What I want to do is split it up a little so it makes it easier on my eyes in the email.

Obviously I've got my subject.
Then the first line of the email says "You've received an e-mail through your website mail form:"

I then want a line space between that and the Name:
Then I want a line space between Country and Feedback:then I want the comments they've written/submitted to be two lines down.

How do I do this?

I tried adding <br /> tags but that caused an error.

Cheers
 

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
Try adding more \n's. So put two on the end of each line instead of one.
 
Status
Not open for further replies.
Top