File: C:/inetpub/vhosts/hrreflections.com/httpdocs/mail-BK/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
}
if(isset($_POST['form_action']) && $_POST['form_action'] == 'send_mail'){
$to = 'careers@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 .= 'Name : ' . $_POST['name'] . "\n\n";
$message .= 'Company Name : ' . $_POST['cname'] . "\n\n";
$message .= 'E-mail Id : ' . $_POST['email'] . "\n\n";
$message .= 'Contact No : ' . $_POST['Contact-No'] . "\n\n";
$message .= 'Current Job Designation: ' . $_POST['Current-Job'] . "\n\n";
$message .= 'Industry Type: ' . $_POST['industry'] . "\n\n";
$message .= 'Current CTC (in lacs) Yearly : ' . $_POST['Current-CTC'] . "\n\n";
$message .= 'Experience : : ' . $_POST['experience'] . "\n\n";
$message .= 'Current job Location : ' . $_POST['Current-Job'] . "\n\n";
$message .= 'Upload Resume : ' . $_POST['file'] . "\n\n";
$attachment = chunk_split(base64_encode(file_get_contents($_FILES['file']['tmp_name'])));
$filename = $_FILES['file']['name'];
$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();
$message="This is a multi-part message in MIME format.
header('Location:thankyou.html');
exit();
}
?>