i need to have the person's email address show as the "from" when i receive the emails. i want to have an autoresponder set up but cant do that until i get it done.
please advise.
thanks
seth
<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
session_start(); if( ($_SESSION['security_code']==$_POST['security_code']) && (!empty($_POST['security_code'])) ) { mail("firstsendtoemail@email.com, secondsendtoemail@email.com","Contact Us Form ","Form data:
Name: " . $_POST['field_1'] . " Phone (123)-456-7890: " . $_POST['field_3'] . " Reason For Contact: " . $_POST['field_7'] . " Email Address: " . $_POST['field_8'] . " ", "From: theaddresstoshowinthefrom@email.com\r\n");
include("confirm.html"); } else { echo "Invalid Security Code. Please go back and try again."; }
?>
I believe
mail("firstsendtoemail@email.com, secondsendtoemail@email.com",$_POST[field_8],"Contact Us Form ","Form data:
Try that and see if it works, I'm not a php developer, but it worked for one of my forms, but it didn't on another one.
thats putting the users email as the subject...
is there any order ?? if so, where does the users email address go?
mail("sendto","subject","form data")
the way that i have it, (which sends from an email that i set up "form@mydomain.com") it is after the form data
mail("sendto","subject","form data","from: form@...com")
Look for this text "Code below works without errors" at the site below for a good example. http://php.net/mail
Log in to post a comment.
i need to have the person's email address show as the "from" when i receive the emails. i want to have an autoresponder set up but cant do that until i get it done.
please advise.
thanks
seth
<?php
$where_form_is="http://".$_SERVER['SERVER_NAME'].strrev(strstr(strrev($_SERVER['PHP_SELF']),"/"));
session_start();
if( ($_SESSION['security_code']==$_POST['security_code']) && (!empty($_POST['security_code'])) ) {
mail("firstsendtoemail@email.com, secondsendtoemail@email.com","Contact Us Form ","Form data:
Name: " . $_POST['field_1'] . "
Phone (123)-456-7890: " . $_POST['field_3'] . "
Reason For Contact: " . $_POST['field_7'] . "
Email Address: " . $_POST['field_8'] . "
", "From: theaddresstoshowinthefrom@email.com\r\n");
include("confirm.html");
}
else {
echo "Invalid Security Code. Please go back and try again.";
}
?>
I believe
mail("firstsendtoemail@email.com, secondsendtoemail@email.com",$_POST[field_8],"Contact Us Form ","Form data:
Try that and see if it works, I'm not a php developer, but it worked for one of my forms, but it didn't on another one.
thats putting the users email as the subject...
is there any order ?? if so, where does the users email address go?
mail("sendto","subject","form data")
the way that i have it, (which sends from an email that i set up "form@mydomain.com") it is after the form data
mail("sendto","subject","form data","from: form@...com")
Look for this text
"Code below works without errors"
at the site below for a good example.
http://php.net/mail