File: C:/inetpub/vhosts/hrreflections.com/httpdocs/job-seeker.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
}
//define email boundaries
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$headers .= "\nMIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/mixed;\n";
$headers .= " boundary=\"{$mime_boundary}\"";
$message ="\n\n--{$mime_boundary}\n";
$message .="Content-Type: text/plain; charset=\"iso-8859-1\"\n";
$message .="Content-Transfer-Encoding: 7bit\n\n" . $msg . "\n\n";
$message .= "--{$mime_boundary}\n";
if(isset($_POST['form_action']) && $_POST['form_action'] == 'send_mail'){
$to = 'careers@hrreflections.com';
//$to = 'test@savit.in';
//$Bcc = 'eclients@savit.in';
$from_name = 'HR Reflections';
$subject = 'Job Seeker Enquiry Form - ' . 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 .= 'Name : ' . $_POST['name'] . "\n\n";
$message .= 'Company Name : ' . $_POST['cname'] . "\n\n";
$message .= 'E-mail Id : ' . $_POST['email'] . "\n\n";
$message .= 'Contact No : ' . $_POST['con'] . "\n\n";
$message .= 'Current Job Designation : ' . $_POST['Cur-j'] . "\n\n";
$message .= 'Industry Type : ' . $_POST['industry'] . "\n\n";
$message .= 'Current CTC : ' . $_POST['Current-CTC'] . "\n\n";
$message .= 'Experience : ' . $_POST['experience'] . "\n\n";
$message .= 'Current job Location: ' . $_POST['Current-Job-location'] . "\n\n";
$message .= 'Upload Resume: ' . $_POST['attachment'] . "\n\n";
$message .= "Content-Type: {\"application/octet-stream\"};\n";
$message .= " name=\"$file\"\n";
$message .= "Content-Disposition: attachment;\n";
$message .= " filename=\"$file\"\n";
$message .= "Content-Transfer-Encoding: base64\n\n" . $data . "\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:thank-you.html');
exit();
}
?>