emailtrabalhe; $email_reply = $rescon->emailnao; $curriculo = $_POST['curriculo']; $curriculo = isset($_FILES["curriculo"]) ? $_FILES["curriculo"] : FALSE; if($curriculo){ $curriculo_expl = explode(".", $_FILES["curriculo"]["name"]); $curriculo_name = "curriculo-" . date('dmYHis') . "-" . remove_acentos($_POST[nome]) . "." . $curriculo_expl[count($curriculo_expl) -1]; } if(file_exists($curriculo["tmp_name"]) && !empty($curriculo)){ $fp = fopen($_FILES["curriculo"]["tmp_name"], "rb"); $anexo = fread($fp, filesize($_FILES["curriculo"]["tmp_name"])); $anexo = base64_encode($anexo); fclose($fp); $anexo = chunk_split($anexo); $boundary = "XYZ-" . date("dmYis") . "-ZYX"; $mensagem_respost = "

$Copyright. Todos os direitos reservados.

"; $corpo_resposta = "--$boundary\n"; $corpo_resposta .= "Content-Transfer-Encoding: 8bits\n"; $corpo_resposta .= "Content-Type: text/html; charset=iso-8859-1\n\n"; $corpo_resposta .= nl2br($mensagem_respost)."\n"; $corpo_resposta .= "--$boundary\n"; $corpo_resposta .= "Content-Type: ".$curriculo_expl."\n"; $corpo_resposta .= "Content-Disposition: attachment; filename=".$curriculo_name."\n"; $corpo_resposta .= "Content-Transfer-Encoding: base64\n\n"; $corpo_resposta .= "$anexo\n"; $corpo_resposta .= "--$boundary--\r\n"; $headers = "MIME-Version: 1.0"."\n"; $headers .= "From: $email_assunto <$email_destinatario>\n"; $headers .= "Content-type: multipart/mixed; boundary=" .$boundary ."\r\n"; $headers .= "$boundary\n"; if(!empty($nome) && !empty($email) && !empty($googleRecaptcha)){ mysql_query("INSERT INTO $tb_emails (lista_id, nome, email, datahora, ip, navegador) VALUES ('8', '$nome', '$email', '$datahora', '$email_ip', '$email_navegador');") or die(mysql_error()); mail($email_destinatario, $email_assunto, $corpo_resposta, $headers, '-f'.$email_reply); $sucesso = true; } else { $response = $reCaptcha->verifyResponse( $_SERVER["REMOTE_ADDR"], $_POST["g-recaptcha-response"] ); $erro = true; } } else { $erroc = true; } } ?>
Currículo enviado com sucesso! Em breve entraremos em contato. Campos em branco! Por favor preencha todos os campos, clique aqui para voltar. Anexo em branco! Por favor selecione um currículo para anexar, clique aqui para voltar.