Forum Moderators: coopster
I do not know how to put the $msg_body into array. I need to email the following variables:
$name
$email
$Dogname
$city
how do I populate the array ($msg_body) with the above variables.
I am using this script to send the mail:
$message = "";
$message .= "$msg_body";
$subject = "Register your dog";
$thisemail = "myemail@mydomain.com";
$headers = "From: dogy pics<myemail@mydomain.com>\n";
$headers .= "X-Sender: <myemail@mydomain.com>\n";
$headers .= "X-Mailer: PHP\n"; //mailer
$headers .= "X-Priority: 1\n"; //1 UrgentMessage, 3 Normal
$headers .= "Return-Path: <myemail@mydomain.com>\n";
mail($thisemail, "$subject", "$msg_body",$headers);
thank you
To send $dogname, $catname, and $fishname to $petowner you would use code like this:
mail [php.net]($petowner,
"A message regarding $dogname, $catname, and $fishname",
$dogname . $catname . $fishname,
"From: Your Turtle <turtle@airboy.com>\n\r");
or
mail [php.net]($petowner,
"A message regarding $dogname, $catname, and $fishname",
sprintf [php.net]("Name of your dog: %s\nName of your cat: %s\nName of your fish: %s",
$dogname, $catname, $fishname),
"From: Your Turtle <turtle@airboy.com>\n\r");
HTH Andreas