🚀 New Job Application

Infinitix Infotech Careers Portal

Position Applied For{$position}
Full Name{$full_name}
Email Address{$email}
Mobile Number{$phone}
Current Location{$current_location}
Years of Experience{$experience}
Current Company" . ($current_company ?: 'N/A') . "
Current Salary" . ($current_salary ?: 'N/A') . "
Expected Salary" . ($expected_salary ?: 'N/A') . "
Notice Period" . ($notice_period ?: 'N/A') . "
Portfolio URL" . ($portfolio_url ? "{$portfolio_url}" : 'N/A') . "
LinkedIn Profile" . ($linkedin_url ? "{$linkedin_url}" : 'N/A') . "
Key Skills" . ($skills ?: 'N/A') . "
Attached Resume{$newFileName}
" . ($cover_letter ? "

Cover Letter:

" . nl2br($cover_letter) . "
" : "") . "
"; $mailSent = false; $mailErrorMessage = ''; if (class_exists('PHPMailer\PHPMailer\PHPMailer')) { try { $mail = new PHPMailer(true); // ====================================================================== // SMTP CONFIGURATION (Configured for cPanel / Gmail SMTP) // Edit credentials below when deploying to live server // ====================================================================== $mail->isSMTP(); $mail->Host = 'smtp.gmail.com'; // SMTP Host (e.g. smtp.gmail.com or mail.infinitixinfotech.in) $mail->SMTPAuth = true; $mail->Username = '[email protected]'; // SMTP Username $mail->Password = 'YOUR_GMAIL_APP_PASSWORD'; // SMTP App Password / Password $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; $mail->Port = 587; // TCP port to connect to // Recipients $mail->setFrom('[email protected]', 'Infinitix Careers'); $mail->addAddress($recipientEmail, 'Infinitix HR Team'); $mail->addReplyTo($email, $full_name); // Resume Attachment $mail->addAttachment($targetFilePath, $newFileName); // Content $mail->isHTML(true); $mail->Subject = $emailSubject; $mail->Body = $emailBody; $mail->AltBody = "New Job Application for {$position}\nName: {$full_name}\nEmail: {$email}\nPhone: {$phone}\nExperience: {$experience}"; $mail->send(); $mailSent = true; } catch (Exception $e) { $mailErrorMessage = $e->getMessage(); } } // Fallback to standard PHP mail() if PHPMailer fails or SMTP is unconfigured locally if (!$mailSent) { $boundary = md5(time()); $headers = "MIME-Version: 1.0\r\n"; $headers .= "From: Infinitix Careers \r\n"; $headers .= "Reply-To: {$email}\r\n"; $headers .= "Content-Type: multipart/mixed; boundary=\"{$boundary}\"\r\n"; $message = "--{$boundary}\r\n"; $message .= "Content-Type: text/html; charset=UTF-8\r\n"; $message .= "Content-Transfer-Encoding: 7bit\r\n\r\n"; $message .= $emailBody . "\r\n\r\n"; // Attachment if (file_exists($targetFilePath)) { $fileContent = chunk_split(base64_encode(file_get_contents($targetFilePath))); $message .= "--{$boundary}\r\n"; $message .= "Content-Type: application/octet-stream; name=\"{$newFileName}\"\r\n"; $message .= "Content-Transfer-Encoding: base64\r\n"; $message .= "Content-Disposition: attachment; filename=\"{$newFileName}\"\r\n\r\n"; $message .= $fileContent . "\r\n\r\n"; } $message .= "--{$boundary}--"; $mailSent = @mail($recipientEmail, $emailSubject, $message, $headers); } // Return Final Output echo json_encode([ 'success' => true, 'message' => 'Thank you for applying! Our HR team will review your application and resume file (' . $newFileName . '). We will contact you soon.' ]); exit;