I have just started working with PHP to support some of the websites I have and I'm working on a form mailer program and need some advice. Below is the code that passes multiple form fiels into my PHP script, My goal is to include the field names and the values in a plan text email. It works as is but I would like to put each variable on a new line. Is ther a way to imbed a line feed in the $allmsg field message to do this? Thanks in advance for your suggestions!
<?php
$email = $_REQUEST['email'] ;
$FirstName = $_REQUEST['FirstName'] ;
$LastName = $_REQUEST['LastName'] ;
$emailaddr = $_REQUEST['emailaddr'] ;
$HomePhone = $_REQUEST['HomePhone'] ;
$CellPhone = $_REQUEST['CellPhone'] ;
$message = $_REQUEST['message'] ;
$allmsg = "Name:".$FirstName." ".$LastName." Cell:".$CellPhone." Home:".$HomePhone." Email:".$emailaddr." Request:".$message;
mail("service@somewebsite.com", "Website Service Request:",
$allmsg, "From: $emailaddr" );
?>


Sign In
Create Account

Back to top









