Hey all,
I’m completely and hopelessly perplexed with a mailform I’ve created. I followed many tutorials but I have one huge problem… the mail only goes to an internal address.
I have a field on the form where a user enters their email and they are supposed to receive a confirmation email… but the email only sends to internal addresses.
The second problem is that there is supposed to be an email sent with all the form details to email@here.com or whatever, and it will only send if the email address entered in the field matches. So, for example, entering email2@here.com in the field won’t send the admin an email… only by entering email@here.com will it go through. any ideas? I’m totally confused. thanks
Woody
OH, here is some code…
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "
";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "
";
$headers .= "From: $field1 $field2 <$field12>" . "
";
$header = 'MIME-Version: 1.0' . "
";
$header .= 'Content-type: text/html; charset=iso-8859-1' . "
";
$header .= "From: $recipientname <$recipientemail>" . "
";
// send mail to admin and print success message
mail($recipientemail, $subject, $message, $headers);
// send mail to user as either html or plain text
if ($autoresponse == "yes") {
if ($field14 == "HTML") {
$autosubject = stripslashes($autosubject);
$automessagehtml = stripslashes($automessagehtml);
mail($field12,"$autosubject","$automessagehtml", "$header");
} else {
$autosubject = stripslashes($autosubject);
$automessage = stripslashes($automessage);
mail($field12,"$autosubject","$automessage", "From: $recipientname <$recipientemail>");
}
}