Jump to content

Archived

This topic is now archived and is closed to further replies.

Dalbot

How to get breaks in form email?

Recommended Posts

hi there! I need help. I have a php form, and it works. The problem is, I need it to have breaks < br > between the lines in the email that gets sent. Right now it comes in like this:

First Name: BobLast Name: DylanDaytime Phone Number: 111-222-3333Email Address: test@yahoo.comInterested Model: 4RunnerInterested Year: 2006Comments: This is a test.

I've tried adding < br > in the code but it's not working. Maybe I'm not placing them right.

How can I get line breaks?? Thanks!


[code]
<?php
require_once('mailclass.php');
$fname = trim($_POST['f1']);
$lname = trim($_POST['f2']);
$phone = trim($_POST['f3']);
$email = trim($_POST['f4']);
$vehicle = trim($_POST['f5']);
$year = trim($_POST['f6']);
$comments = trim($_POST['f7']);

$mymail = 'mail@xxxxxxxxxxx.com';
$from = 'mail@xxxxxxxxxxxx.com';

$subject = 'Contact';
$content .= 'First Name: '.$fname.'';
$content .= 'Last Name: '.$lname.'';
$content .= 'Daytime Phone Number: '.$phone.'';
$content .= 'Email Address: '.$email.'';
$content .= 'Interested Model: '.$vehicle.'';
$content .= 'Interested Year: '.$year.'';
$content .= 'Comments: '.$comments.'';
$mail = new email ( $subject, $content, "Dealersite.com", $from, $mymail);
$mail->send();
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL=thankyou.php">';
?>
[/code]

Share this post


Link to post
Share on other sites
Use the newline char "\n" as the line break. Don't forget to put it between DOUBLE QUOTES.

Ronald  8)

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.