Bom inserindo aqui um tutorial para envio de e-mail com anexo bem funcional já testado
#pega variaveis do formulario
$nome=$_POST['nome'];
$telefone=$_POST['telefone'];
$cidade=$_POST['cidade'];
$email=$_POST['email'];
$attach=$_FILES['curriculo'];
#monta mensagem que será enviada com o anexo
$msg=’Curriculo de ‘.$nome.’
Telefone ‘.$telefone.’
Cidade ‘.$cidade.’
Email ‘.$email;
#ele pega a array do arquivo e passa para a array $attach
$attach = $arquivo['name'];
#configuração do header do e-mail
$mailheaders = “From: $from\n”;
$mailheaders .= “Reply-To: $from\n”;
$mailheaders .= “Cc: $cc\n”;
$mailheaders .= “Bcc: $bcc\n”;
$mailheaders .= “X-Mailer: Script para enviar arquivo anexado\n”;
$msg_body = stripslashes($body);
#abre o arquivo e faz a rotina para poder anexar o arquivo
$file = fopen($attach['tmp_name'],”r+”);
$contents = fread ($file, filesize ($attach['tmp_name']));
$encoded_attach = chunk_split(base64_encode($contents ));
fclose($file);
$mailheaders .= “MIME-version: 1.0\n”;
$mailheaders .= “Content-type: multipart/mixed; “;
$mailheaders .= “boundary=\”Message-Boundary\”\n”;
$mailheaders .= “Content-transfer-encoding: 7BIT\n”;
$mailheaders .= “X-attachments: $attach_name”;
#monta o corpo da mensagem
$body_top = “–Message-Boundary\n”;
$body_top .= “Content-type: text/plain; charset=US-ASCII\n”;
$body_top .= “Content-transfer-encoding: 7BIT\n”;
$body_top .= “Content-description: Mail message body\n\n”;
$msg_body = $body_top . $msg . $msg_body;
$msg_body .= “\n\n–Message-Boundary\n”;
$msg_body .= “Content-type: “.$attach['type'].”; name=\”".$attach['name'].”\”\n”;
$msg_body .= “Content-Transfer-Encoding: BASE64\n”;
$msg_body .= “Content-disposition: attachment; filename=\”".$attach['name'].”\n\n”;
$msg_body .= “$encoded_attach\n”;
$msg_body .= “–Message-Boundary–\n”;
#e-mail para onde será enviado o e-mail com anexo
$email_enviar=”andre.luiz@####.com.br”;
#envia o e-mail
if (mail($email_enviar, stripslashes($subject), $msg_body, $mailheaders)){
$estado=”sucesso”;
}else{
$estado=”erro”;
}
é só colocar na página de action do seu form com os campos que você vai precisar e está feito rs
Até!