Mas agora eu testei e deu tudo certo por aqui. Veja aqui.
Ficou assim:
<?php
$nome = $_POST["nome"];
$telefone = $_POST["telefone"];
$mensagem = $_POST["mensagem"];
$body = "Nome: $nome
Telefone: $telefone
Mensagem: $mensagem";
$to = "contato@pedefolha.com.br, luiz.noronha@terra.com.br";
$from = $_POST["email_from"];
$subject = "Contato via website";
$attach = $_FILES["arquivo"]["tmp_name"];
$attach_name = $_FILES["arquivo"]["name"];
$attach_size = $_FILES["arquivo"]["size"];
$attach_type = $_FILES["arquivo"]["type"];
$headers = "MIME-Version: 1.0\n";
$headers .= "From: " . $nome . "<" . $from . ">\r\n";
$headers .= "Reply-To: " . $from . "\r\n";
$headers .= "Content-type: multipart/mixed; boundary=\"XYZ-" . date('dmyhms') . "-ZYX\"\r\n";
$msg_body = "--XYZ-" . date('dmyhms') . "-ZYX\n";
$msg_body .= "Content-Transfer-Encoding: 8bits\n";
$msg_body .= "Content-Type: text/plain; charset=\"ISO-8859-1\"\n\n";
$msg_body .= stripslashes($body);
$msg_body .= "\n";
if ($attach != "") {
$fp = fopen($attach, 'rb');
$content = fread($fp, filesize($attach));
$encoded = chunk_split(base64_encode($content));
fclose($fp);
$msg_body .= "--XYZ-" . date('dmyhms') . "-ZYX\n";
$msg_body .= "Content-Type: " . $attach_type . "\n";
$msg_body .= "Content-Disposition: attachment; filename=\"" . $attach_name . "\" \n";
$msg_body .= "Content-Transfer-Encoding: base64\n\n";
$msg_body .= "$encoded\n";
$msg_body .= "--XYZ-" . date('dmyhms') . "-ZYX\n";
}
$mail = mail($to, stripslashes($subject), $msg_body, $headers);
if ($mail) echo "Enviado!";
?>Edit @18h04
Ops, agora que vi que você editou. Mas beleza, fica ai a dica caso queira usar este outro método.
[]'sAté mais
- Loi likes this



Postagens
Male

