File: C:/inetpub/vhosts/hrreflections.com/httpdocs/contact-us.php
<?php
include_once("lib/phpmailer/smtp_config.php");
include_once("lib/phpmailer/class.phpmailer.php");
$this_form_spam = $_POST['requirements'];
if ($this_form_spam == "")
{
// process the form and send email
}
else
{
// mock and laugh in the face of spam
}
if(isset($_POST['form_action']) && $_POST['form_action'] == 'send_mail'){
$to = 'garima@hrreflections.com, ritesh@hrreflections.com,anuradha@hrreflections.com';
//$to = 'host@savit.in';
//$Bcc = 'eclients@savit.in';
$from_name = 'HR Reflections';
$subject = 'Enquiry recieved on hrreflections.com - ' . date("d M Y, g:i A");
$message = '';
$message .= 'Hi,' . "\n" . 'You have got an enuquiry on hrreflections.com ' . "\n" . 'Details are below'. "\n";
$message .= '-----------------------------------------------------------' . "\n\n";
$message .= 'Company Name : ' . $_POST['cname'] . "\n\n";
$message .= 'Designation : ' . $_POST['designation'] . "\n\n";
$message .= 'Telephone : ' . $_POST['phone'] . "\n\n";
$message .= 'Mobile : ' . $_POST['mobile'] . "\n\n";
$message .= 'E-mail Id : ' . $_POST['email'] . "\n\n";
$message .= 'Website : ' . $_POST['website'] . "\n\n";
$message .= 'Address : ' . $_POST['address'] . "\n\n";
$message .= 'Your Requirements : ' . $_POST['requirements'] . "\n\n";
$message .= '-----------------------------------------------------------' . "\n\n";
$headers = "From: " . $from_name . " <" . $_POST['email'] . ">\n\n";
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = MAIL_HOST;
$mail->SMTPDebug = MAIL_SMTP_DEBUG;
$mail->SMTPAuth = MAIL_SMTP_AUTH;
$mail->Port = MAIL_PORT;
$mail->Username = MAIL_USERNAME;
$mail->Password = MAIL_PASSWORD;
$mail->SMTPSecure = MAIL_SMTP_SECURE;
$mail->SetFrom($_POST['email'], $from_name);
$mail->AddBCC ($Bcc);
$mail->Subject = $subject;
$mail->MsgHTML(nl2br($message));
if($to != ''){
$arr_to_emails = explode(",", $to);
if(count($arr_to_emails))
{
foreach($arr_to_emails as $kToEmail => $vToEmail)
{
if($vToEmail != '')$mail->AddAddress(trim($vToEmail));
}
}
}
$mail->Send();
//mail($to, $subject, $message, $headers);
header('Location:thankyou.html');
exit();
}
?>