// Email address for copies to be sent to - change to suit
$emailto = "myaddress@test.com";
// Notification email subject text for copies
$esubject = "Recommendation form submission friend 1";
$esubjecttwo = "Recommendation form submission friend 2";
$esubjectthree = "Recommendation form submission friend 3";
// Email body text for notifications
$emailtextone = "
$_POST[name] has used your recommendation form using an email address of $_POST[email]
The people the recommendation has been submitted to are:
$_POST[fmail1]
Agreed to the contest's rules and conditions: Yes
The page recommended:
$_POST[refurl]
";
// Email body text for notifications
$emailtexttwo = "
$_POST[name] has used your recommendation form using an email address of $_POST[email]
The people the recommendation has been submitted to are:
$_POST[fmail2]
Agreed to the contest's rules and conditions: Yes
The page recommended:
$_POST[refurl]
";
// Email body text for notifications
$emailtextthree = "
$_POST[name] has used your recommendation form using an email address of $_POST[email]
The people the recommendation has been submitted to are:
$_POST[fmail3]
Agreed to the contest's rules and conditions: Yes
The page recommended:
Code:
$_POST[refurl]
";
if ($_POST['fmail1'] !="") && ($_POST['fmail2'] !="") && ($_POST['fmail3'] !="") {
# This function sends the email to you
mail("$emailto", $esubject, $emailtextone, "From: $_POST[email]");
mail("$emailto", $esubjecttwo,$emailtexttwo, "From: $_POST[email]");
mail("$emailto", $esubjectthree, $emailtextthree, "From: $_POST[email]");
} elseif ($_POST['fmail1'] !="") && ($_POST['fmail2'] !="") && ($_POST['fmail3'] =="") {
# This function sends the email to you
mail("$emailto", $esubject, $emailtextone, "From: $_POST[email]");
mail("$emailto", $esubjecttwo,$emailtexttwo, "From: $_POST[email]");
} elseif ($_POST['fmail1'] !="") && ($_POST['fmail2'] =="") && ($_POST['fmail3'] =="") {
# This function sends the email to you
mail("$emailto", $esubject, $emailtextone, "From: $_POST[email]");
} elseif ($_POST['fmail1'] !="") && ($_POST['fmail2'] =="") && ($_POST['fmail3'] !="") {
# This function sends the email to you
mail("$emailto", $esubject, $emailtextone, "From: $_POST[email]");
mail("$emailto", $esubjectthree, $emailtextthree, "From: $_POST[email]");
} else {
echo "";
}
