Mensagem com os seguintesdados:
Nome: " .$_POST['nome']. "
Email: " .$_POST['de']. "
Morada: " .$_POST['morada']. "
Código Postal: " .$_POST['codigo']. "
Fax: " .$_POST['fax']."
Telefone: " .$_POST['telefone']."
Telemóvel: " .$_POST['telemovel']."
Interessado/a em: " .$_POST['interesse']."
Deseja: " .$_POST['deseja']."
Como deseja ser contactado/a: " .$_POST['contacto']."
Mensagem:
"
.nl2br($_POST['msg']). "
"; $message .= "\n"; $attachments[1] = $anexo; foreach ($attachments as $key => $full_path) { if ($full_path !='') { if (file_exists($full_path)){ if ($fp = fopen($full_path,"rb")) { if ((filesize($full_path)/1024) > "3000"){ echo "O arquivo que você tentou anexar, possui mais que 3MB. Por favor, tente um arquivo menor."; exit; } $filename = array_pop(explode(chr(92),$full_path)); $contents = fread($fp,filesize($full_path)); $encoded = base64_encode($contents); $encoded_split = chunk_split($encoded); fclose($fp); $message .= "--$boundary\n"; $message .= "Content-Type: $anexo_type\n"; $message .= "Content-Disposition: attachment; filename=\"$anexo_name\" \n"; $message .= "Content-Transfer-Encoding: base64\n\n"; $message .= "$encoded_split\n"; } else { echo "Impossível abrir o arquivo$key: $filename"; $ABORT = TRUE; } } else { echo "O arquivo$key não existe: $filename"; $ABORT = TRUE; } } } $message .= "--$boundary--\r\n"; $headers = "MIME-Version: 1.0\r\n"; $headers .= "From: <".$_POST['de'].">\r\n"; $headers .= "Content-type: multipart/mixed; boundary=\"$boundary\" charset=iso-8859-1\r\n"; $mensagem = mail($_POST['email'], $assunto, $message, $headers); if ($mensagem) { print "Mensagem enviada com sucesso!"; } else { print "O envio da mensagem falhou!"; } } ?>