Ok I have a for that works but I need to make some changes.
- Change the send to email to the email address entered on the form
- Have the form also send to a bcc address
Here is the code that I think is involved. BTW this is not a site that I created. I just have a friend that wants some changes made to his site.
switch ($_SERVER['HTTP_HOST']) {
case 'www.######.com':
case '######.com':
default:
define ('SITE_PATH', '/home/absentee/public_html');
define ('TEMPLATE_PATH', '/home/absentee/public_html/templates/public/');
define ('STYLE_PATH', '/lib/styles/');
$base_url = 'http://www.######.com';
define ('DEBUG', false);
define ('SUBMIT_TO', '######@######.com');
define ('SUBMIT_BCC', '######@gmail.com');
break;
}
function sendInfo($spam_score = '',$reason = '') {
$subject = 'New notification from the ' . SITE_TITLE . ' website';
$submit_body .= "\n\n";
$submit_body .= 'Last Name: ' . " " . $this->data_array['last_name'];
$submit_body .= "\n\n";
$submit_body .= 'eMail Address: ' . " " . $this->data_array['email_address'];
$submit_body .= "\n\n";
$submit_body .= 'House Address: ' . " " . $this->data_array['address'];
$submit_body .= "\n\n";
$submit_body .= 'Arrival Date: ' . " " . $this->data_array['arrival'];
$submit_body .= "\n\n";
$submit_body .= 'Departure Date: ' . " " . $this->data_array['departure'];
$submit_body .= "\n\n";
$submit_body .= 'Housekeeping: ' . " " . $this->data_array['housekeeping'];
$submit_body .= "\n\n";
$submit_body .= 'Special Instructions: ' . " " . nl2br($this->data_array['tellus']);
$submit_body .= "\n\n\n-----------\n";
$submit_body .= 'IP Address: ' . $this->data_array['ip_address'];
$submit_body .= "\n";
$submit_ret_val=mail(SUBMIT_TO,$subject,$submit_body,HEADERS);
//$debug_subject =SITE_TITLE . ' Notification Debug: IP address ' . $REMOTE_ADDR . ' : _score=' . $spam_score;
//$submit_ret_val=mail(DEBUG_TO,$debug_subject,$submit_body,HEADERS);
if ($submit_ret_val !=1) {
$this->setError("ERROR - Could Not Send Notification\n");
return false;
} else {
//$debug_subject = SITE_TITLE .' Notification Debug: IP address ' . $this->data_array['ip_address'];
//$submit_ret_val=mail(DEBUG_TO,$debug_subject,$submit_body,HEADERS);
return true;
}
}
$headers = "MIME-Version: 1.0 \n";
$headers .= "Content-type: text/plain; charset=iso-8859-1 \n";
$headers .= "From: " . SITE_TITLE . " <notification@######.com> \n";
$headers .= "Reply-To: " . SITE_TITLE . " <notification@######.com> \n";
$headers .= "Bcc: [email protected] \n";
$headers .= "X-Sender: " . SITE_TITLE . " <notification@######.com> \n";
$headers .= "X-Priority: 3 \n";
$headers .= "X-Mailer: " . SITE_TITLE . " \n";
$headers .= "Return-Path: <notification@######.com> \n";
define ('HEADERS', $headers);