Jump to content

[SOLVED] Line breaks not breaking in email


psquillace

Recommended Posts

Hello All:

 

I have a mail script set up as such:

 

$to = '[email protected]';

$subject = 'Dance with CDA Registration Form';

$body = 'This is a registrant that filled out your form on your website' . '<br><br>';

 

 

$from = '[email protected]';

 

$body .= '<b>Registratnt First Name:</b>' . $_POST["Child_First_Name"] . '<br><br>';

 

$body .= '<b>Registratnt Last Name:</b>' . $_POST["Child_Last_Name"] . '<br><br>';

 

$body .= '<b>Registratnt First Name:</b>' . $_POST["Child_Age"] . '<br><br>';

 

However the email comes as one long line.

 

Is there something I am doing wrong here?

 

thanks for any help or advice,

 

PM

Probably getting sent as html.

 

Change the '

 

'; to '<br />';

 

Or better:

 

$to = '[email protected]';

$from = '[email protected]';

 

$subject = 'Dance with CDA Registration Form';

 

$body = 'This is a registrant that filled out your form on your website<br /><br />';

$body .= "Registrant First Name: {$_POST['Child_First_Name']}<br />";

$body .= "Registrant Last Name: {$_POST['Child_Last_Name']}<br />";

$body .= "Registrant Age: {$_POST['Child_Age']}<br />";

 

you may need to set the content-type if you want it to be plain-text, and if so - change the <br /> to \r\n

Archived

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

×
×
  • Create New...

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.