That didn't seem to solve the problem with sending to the hdapp@execpc.com email address. It did still send it to me. I changed it to a different address to be setup and set up an alias with our domain name. This seemed to have fixed it for now. Possibly some kind of blocking at the execpc (corecomm) company.... Although, they are the same company that hosts our site & domain.
I have included the full code for the page below.
<?php # Script 3.13 register.php
if (isset($_POST['submit'])) { // Handle the form.
$message = NULL; // Create an empty new variable.
// Check for a name.
if (strlen($_POST['name']) > 0) {
$name = TRUE;
$namea = $_POST['name'];
} else {
$name = FALSE;
$message .= '<p>Please enter your name.</p>';
}
// Check for an email address.
if (strlen($_POST['email']) > 0) {
$email = TRUE;
$emaila = $_POST['email'];
} else {
$email = FALSE;
$message .= '<p>Please enter your email address.</p>';
}
// Check for a subject.
if (strlen($_POST['subject']) > 0) {
$subject = TRUE;
$subjecta = $_POST['subject'];
} else {
$subject = FALSE;
$message .= '<p>Please enter a subject.</p>';
}
// Check for a message.
if (strlen($_POST['themessage']) > 0) {
$themessage = TRUE;
$themessagea = $_POST['themessage'];
} else {
$themessage = FALSE;
$message .= '<p>Please enter a message.</p>';
}
if ($name && $email && $subject && $themessage) { // If everythong's okayOK.
// Email H-D.
// Send an email.
$body = "You have a request for information.\n\n From: $namea \n Email: $emaila \n\n Message: \n $themessagea \n\nThank You,\nH-D Bike Website";
$frommail = "From: $emaila";
$recipient = "hdapp@execpc.com, [email]tdors@yahoo.com[/email], $emaila";
$mail = mail ($recipient, $subjecta, $body, $frommail );
if($mail) {
header ('Location: thankyou.php');
exit();
} else {
echo "I am sorry there was a problem sending the email. please try again later.";
}
} else { // Something's not TRUE.
$message .= '<p>Please try again.</p>';
}
}
// Print the error message if there is one.
if (isset($message)) {
echo '<font color="red">', $message, '</font>';
}
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<fieldset><legend>Enter your information in the form below:</legend>
<p><b>Name:</b> <input type="text" name="name" size="20" maxlength="40" /></p>
<p><b>Your Email Address:</b> <input type="text" name="email" size="40" maxlength="60" /></p>
<p><b>Send to Email Address: </b> [email]hdapp@execpc.com[/email] </p>
<?php if (isset($refn)) {
$refa = 'Info on Bike Ref # ';
$refa .= $refn;
} else {
$refa = 'Info on Bike';
}
?>
<p><b>Subject:</b> <input type="text" name="subject" size="20" maxlength="60" value="<?php echo $refa; ?>" /></p>
<p><b>Message:</b> <textarea rows="5" name="themessage" cols="50"></textarea></p>
</fieldset>
<div align="center"><input type="submit" name="submit" value="Submit Informaiton" />
</div>
</form><!-- End of Form -->