response.php
[php]<?PHP
session_start();
include (‘globals.php’);
$fname = $_REQUEST[‘fname’] ;
$email = $_REQUEST[‘email’] ;
$phone = $_REQUEST[‘phone’] ;
$company = $_REQUEST[‘company’] ;
$comments = $_REQUEST[‘details’] ;
if (md5($_REQUEST[‘code_check’])==$_COOKIE[$site_cookie_verifyimage_name]) {
unset($_SESSION['fname']);
unset($_SESSION['email']);
unset($_SESSION['phone']);
unset($_SESSION['company']);
unset($_SESSION['details']);
// multiple recipients
//ini_set(“SMTP”,“192.168.0.40”);
$to = ‘[email protected]’ . ', '; // add additional mail receipient here. Uncomment to activate
//$to .= ‘[email protected]’ . ', '; // add additional mail receipient here. Uncomment to activate
//$to .= ‘[email protected]’; // add additional mail receipient here
// subject
$subject = 'You have received a mail from ‘.$fname.’ '.$lname; //Modify the mail subject here
//$subject = ‘Message from ‘.$name.’ via domain.dom’;
// message
$message = ’
<tr>
<td width="434" height="22">Full Name:</td>
<td width="779" height="22">'.$fname.'</td>
<tr>
<td width="434" height="22">Email:</td>
<td height="22">'.$email.'</td>
</tr>
<tr>
<td height="22">Phone No:</td>
<td height="22">'.$phone.'</td>
</tr>
<tr>
<td height="22">Company Name:</td>
<td height="22">'.$company.'</td>
</tr>
<tr>
<td height="22">Comments:</td>
<td height="22">'.$details.'</td>
</tr>
</table>';
// To send HTML mail, the Content-type header must be set
$headers = ‘MIME-Version: 1.0’ . “\r\n”;
$headers .= ‘Content-type: text/html; charset=iso-8859-1’ . “\r\n”;
// Additional headers
$headers .= ‘From: ‘.$fname.’ <’.$email.’>’. “\r\n”;
//$headers .= ‘Cc: [email protected]’. “\r\n”; // Add cc recepient here. Uncomment to activate
//$headers .= ‘Cc: [email protected]’. “\r\n”; // Add next cc recepient here. Uncomment to activate
//$headers .= ‘Bcc: [email protected]’. “\r\n”; // Add bcc recepient here. Uncomment to activate
// Replace apostrophe character
$message = str_replace("’","’",$message);
// Mail it now
if(mail($to, $subject, $message, $headers)){
header( "Location: contact.php?sent=1");
}else{
header( "Location: contact.php?sent=0");
}
} else {
header( “Location: contact.php?sent=2”);
}
?>[/php]