Forum Moderators: coopster
This is the code after $message was composed. recipientList was set to X@here.com, $subject was set, and the parameterList was set like the following.
// Handle the actual Email part.
//Send to this email address, delimit the email addresses by commas.
$recipientList = "X@here.com";
//This sets up the From feild
$parameterList = "From: ".$last." ".$first." <".$email.">\r\n"."Reply-To: ".$email."\r\n";
//This is the subject line containing last name, first name
$subject = $last.", ".$first.", TEST EMAIL";
... then this is what I do with it...
//Mail it out after everything is set in the message.
mail( $recipientList, $subject, $message, $parameterList );
...now the auto-reply, which emails to the recipentList from above and not the newly set one below...
//Mail the auto-reply
$recipentList = $email;
$subject = "Auto-Reply Experience Profile Submittion Successful";
$message ="Thank you for submitting your Experience Profile.";
$message .="\nWe will add this to your application when it is recieved.";
$message .="\nAny further questions please refer to our website,";
$message .="\n and the FAQs and Inquiries page.";
$message .="\n ";
//Leaving parameterList so if they reply it goes back to them.
mail( $recipientList, $subject, $message, $parameterList );
header ( "Location: success.php" );
?>
So what the heck am I doing wrong? Can you send 2 emails from one script?
//Leaving parameterList so if they reply it goes back to them.
mail( $email, $subject, $message, $parameterList );
Also make sure the variable $email has a value by echoing it somewhere on your page.
echo $email;
:)