FPMSI
January 26, 2012, 7:14pm
1
Using the below portion of php to send html form values to an email address. You notice that $message is equal to one form field “first_name”, How can i get the message to include all fields, (first_name, last_name, phone, company, website).
else
{//send email
$email = $_REQUEST['email'] ;
$subject = "Email Marketing Template - Downloaded" ;
$message = $_REQUEST['first_name'];
mail("email@email.com", "Subject: $subject",
$message, "From: $email" );
header('Location: http://www.mymarketingsolutions.com/');
}
}
else
Thanks
Ryan.
You could concatenate them.
FPMSI
January 26, 2012, 8:28pm
3
Sorry really dont have much PHP knowledge at all. Would this allow me to format the email so the data comes over clean?
Email message:
first_name last_name
email
phone
address
company
website
Some how to add a break < /br>
$message = $_REQUEST['first_name'];
$message.= $_REQUEST['last_name'];
$message.= $_REQUEST['phone'];
lorenw
January 26, 2012, 10:51pm
4
Your email is plain text, try,
$message = $_REQUEST['first_name']."\\r\
";
$message.= $_REQUEST['last_name']."\\r\
";
$message.= $_REQUEST['phone']."\\r\
";
ralphm
January 26, 2012, 11:06pm
5
You could try something like this:
if (@$_POST["submitted"]) {
$name1 = $_POST["first_name"];
$name2 = $_POST["last_name"];
$emailad = trim($_POST["email"]);
$addre = $_POST["address"];
$comp = $_POST["company"];
$phoneno = $_POST["phone"];
$site = $_POST["website"];
$message =
"Name: $name1 $name2\
\
" .
"Email: $emailad\
\
" .
"Phone Number: $phoneno\
\
" .
"Address: $addre\
\
" .
"Company: $comp\
\
" .
"Website: $site";
}
FPMSI
January 27, 2012, 2:53pm
6
Thank you - much appreciated.