<?php
$sendTo = "[email protected]";
$subject = "xxxxxx";
$headers = "From: " . $_POST["Name"];
$headers .= "<" . $_POST["Email"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["Email"] . "\r\n";
$headers .= "Return-Path: " . $_POST["Email"];
$message = $_POST["Phone"];
mail($sendTo, $subject, $message, $headers);
?>
gurdas said:Thankyou I have it working great now, much easier to use php. But I just have one addon that I need, at the moment the script looks like this
Code:<?php $sendTo = "[email protected]"; $subject = "xxxxxx"; $headers = "From: " . $_POST["Name"]; $headers .= "<" . $_POST["Email"] . ">\r\n"; $headers .= "Reply-To: " . $_POST["Email"] . "\r\n"; $headers .= "Return-Path: " . $_POST["Email"]; $message = $_POST["Phone"]; mail($sendTo, $subject, $message, $headers); ?>
The main message of the email being the phone number, but I have an extra variable called University that I wish to appear in the body of the email too, how do I modify the code to do this? (I'm not really fluent in php)
<?php
$sendTo = "[email protected]";
$subject = "xxxxxx";
$headers = "From: " . $_POST["Name"];
$headers .= "<" . $_POST["Email"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["Email"] . "\r\n";
$headers .= "Return-Path: " . $_POST["Email"];
$message = . "Phone: " . $_POST["Phone"] . "\nUniversity: " . $_POST["University"];
mail($sendTo, $subject, $message, $headers);
?>
<?php
$sendTo = "[email protected]";
$subject = "xxxxxx";
$headers = "From: " . $_POST["Name"];
$headers .= "<" . $_POST["Email"] . ">\r\n";
$headers .= "Reply-To: " . $_POST["Email"] . "\r\n";
$headers .= "Return-Path: " . $_POST["Email"];
$message = "Phone: " . $_POST["Phone"] . " University: " . $_POST["University"];
mail($sendTo, $subject, $message, $headers);
?>