/home/u764571690/domains/savitrfoundation.com/public_html
Edit: /home/u764571690/domains/savitrfoundation.com/public_html/sendmail.php (2720B)
\r\n";
$headers .= "Reply-To: $email\r\n";
$headers .= "Content-Type: text/plain; charset=UTF-8\r\n";
// Handle file upload
if(isset($_FILES['resume']) && $_FILES['resume']['error'] == 0){
$resume = $_FILES['resume'];
$filename = $resume['name'];
$filetype = $resume['type'];
$filesize = $resume['size'];
$filetmp = $resume['tmp_name'];
// Read the file content and encode it
$handle = fopen($filetmp, "rb");
$content = fread($handle, $filesize);
fclose($handle);
$encoded_content = chunk_split(base64_encode($content));
// Generate a boundary string
$boundary = md5(time());
// Update headers for multipart message
$headers = "From: $name <$email>\r\n";
$headers .= "Reply-To: $email\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: multipart/mixed; boundary=\"$boundary\"\r\n\r\n";
// Plain text part
$body = "--$boundary\r\n";
$body .= "Content-Type: text/plain; charset=UTF-8\r\n";
$body .= "Content-Transfer-Encoding: 7bit\r\n\r\n";
$body .= "Name: $name\n";
$body .= "Mobile: $mobile\n";
$body .= "Email: $email\n";
$body .= "Job Role: $jobrole\n\n";
$body .= "Message:\n$message\n\r\n";
// Attachment part
$body .= "--$boundary\r\n";
$body .= "Content-Type: $filetype; name=\"$filename\"\r\n";
$body .= "Content-Transfer-Encoding: base64\r\n";
$body .= "Content-Disposition: attachment; filename=\"$filename\"\r\n\r\n";
$body .= $encoded_content."\r\n";
$body .= "--$boundary--";
}
// Try to send email
if(mail($to, $subject, $body, $headers)){
echo "Application sent successfully!";
}else{
echo "Failed to send application. Please try again.";
}
} else {
echo "Invalid request.";
}
?>