0
A form I tested on my web server (www.sitedodaniel.com.br/box/send/formgamer.php) worked perfectly.
However, when transposing the code to an intranet server of my company, the form is displayed, but the following messages appear at the top of the browser:
Notice: Undefined index: frm_ok in E:\Website[caminho do servidor]\formgamer.php on line 2 
Notice: Undefined index: Nome do Remetente in E:\Website[caminho do servidor]\formgamer.php on line 3 
Notice: Undefined index: email in E:\Website[caminho do servidor]\formgamer.php on line 4 
Notice: Undefined index: destino in E:\Website\E:\Website[caminho do servidor]\formgamer.php on line 6 
Follows code:
<?php 
$subm = $_POST['frm_ok'];   // Váriavel que indica que o formulário foi submetido 
$name = $_POST['Nome do Remetente'];     // Nome do remetente(Emissor) 
$mail = $_POST['email'];    // Segue o endereço de email do remetente 
$__sj = "Formulário de Contato";    // Informe um assunto para a mensagem 
$__to = $_POST['destino']; // Defina o email do destinatário(Receptor), para mais de um separe-os com vírgula 
// Verifico se o formulário foi submetido 
if(isset($subm)): 
// Descomente a linha abaixo, se você quiser analisar as variáveis que estão sendo passadas pelo formulário via post 
//echo "<pre>",print_r($_POST),"</pre>"; 
// Filtro algumas váriaveis passadas 
$find = "/(content-type|bcc:|cc:)/i"; 
if(preg_match($find, $name) || preg_match($find, $mail)) 
exit("<h3>Sem meta/header inclusões, por favor.</h3>"); 
// Valido o email do remetente, usando expressão regular 
$regex = "^([[:alnum:]]+)([-._]([[:alnum:]]+))*[@]([[:alnum:]]+)([-._]([[:alnum:]]+))*[.]([[:alnum:]]){2}([[:alnum:]])?$"; 
if(isset($mail) && !ereg($regex, $mail)) 
$erro = 1; 
// Mensagem formatada, enviada no corpo do email 
$html = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\"> 
<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"pt-BR\" lang=\"pt-BR\"> 
<head> 
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=iso-8859-1\"> 
<style> 
body     {background:#FFFFFF;} 
a, a:link   {color:#5b6105; text-decoration:none;} 
#tab     {margin:0; padding:0px; width:500px; border:1px solid #8F8E96; padding:10px;} 
#tab tr {background:#F6F6F6; } 
#tab td {color:#000000; font: normal 11px arial, helvetica, sans-serif; border:dashed 1px #DDD; padding:30px;} 
</style> 
</head> 
<body> 
<br /> 
<table border='0' cellspacing='10' cellpadding='0' id='tab' align='center'> 
<tr> 
<td> 
<b>Nome:</b> {$name}<br /> 
<b>Email:</b> {$mail}<br /> 
<b>Telefone:</b> {$_POST['telefone']}<br /><br /> 
<b>Mensagem:</b> {$_POST['mensagem']}<br /> 
</td> 
</tr> 
</table> 
<br /> 
</body> 
</html> 
"; 
// Resolvo a diferença de quebra de linhas, entre o Linux e o Windows 
$snap = (PHP_OS == "Linux")?"\n":((PHP_OS == "WINNT")?"\r\n":exit()); 
// Verifico se o formulário postado, possui arquivos anexos 
$file = (isset($_FILES["arquivo"]) && in_array("0",$_FILES["arquivo"]["error"]))?$_FILES["arquivo"]:FALSE; 
// Executo a condição seguinte, se identificar um ou mais anexos junto a mensagem 
if($file){ 
// É removido da matriz os anexos falsos 
for($x=0; $x<count($_FILES["arquivo"]["name"]); $x++): 
if(empty($file['name'][$x])){ 
unset($file['name'][$x]); 
unset($file['size'][$x]); 
unset($file['type'][$x]); 
unset($file['tmp_name'][$x]); 
unset($file['error'][$x]); 
}else{ 
$attach[] = array( 
$file['name'][$x], 
$file['size'][$x], 
$file['type'][$x], 
$file['tmp_name'][$x] 
); 
} 
endfor; 
$boundary = "==Multipart_Boundary_x".md5(time())."x"; 
$body = stripslashes($html); 
// Criamos os cabeçalhos MIME utilizados para separar as partes da mensagem MIME 
$html = "--".$boundary.$snap; 
$html.= "Content-Transfer-Encoding: 8bits".$snap; 
$html.= "Content-Type: text/html; charset=\"ISO-8859-1\"".$snap.$snap; 
$html.= $body.$snap; 
$html.= "--".$boundary.$snap; 
for($i=0; $i<sizeof($attach); $i++): 
if(is_uploaded_file($attach[$i][3])){ 
$Name = $attach[$i][0]; 
$Size = $attach[$i][1]; 
$Type = $attach[$i][2]; 
$Temp = $attach[$i][3]; 
if((strlen($Name)>1) && ($Size>0)){ 
$fopen = fopen($Temp,"rb"); // Fazemos a leitura do arquivo a ser anexado em leitura binária(rb) 
$fread = fread($fopen, filesize($Temp)); 
$cript = base64_encode($fread); // Codificamos o arquivo de dados com Base64 
$close = fclose($fopen); 
$chunk = chunk_split($cript); // Convertemos a saída de base64_encode(), conforme semântica RFC 2045 
$html.= "Content-Disposition: attachment; filename=\"{$Name}\"".$snap; 
$html.= "Content-Type: {$Type}; name=\"{$Name}\"".$snap; 
$html.= "Content-Transfer-Encoding: base64".$snap.$snap; 
$html.= $chunk.$snap; 
if(sizeof($attach) == $i+1) $html.= "--".$boundary."--".$snap; 
else $html.= "--".$boundary.$snap; 
} 
} 
endfor; 
// Adiciono os cabeçalhos de um arquivo anexado 
$head = "MIME-Version: 1.0".$snap; 
$head.= "From: {$mail}".$snap; 
$head.= "Content-type: multipart/mixed; boundary=\"{$boundary}\"".$snap; 
$head.= $boundary.$snap; 
} 
// Caso contrário, enviamos uma mensagem html, sem anexos 
else{ 
$head = "MIME-Version: 1.0".$snap; 
$head.= "From: {$mail}".$snap; 
$head.= "Content-type: text/html; charset=\"ISO-8859-1\"".$snap; 
} 
endif; 
?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<title>Multi-Anexos</title> 
<link href="_css/typo.css" rel="stylesheet" type="text/css" /> 
</head> 
<body> 
<div id="div"> 
<h1>Orcamentos - Provas - Outros Contatos</h1>  
<? 
// Se o formulário for enviado sem a presença do email do remetente, é exibido uma mensagem de retorno 
if(isset($erro) && $erro==1): 
?> 
<div style='padding:10px;'> 
<a href='javascript:history.back(1)'>Clique aqui para retornar e informe um <b>email válido</b>!</a> 
</div> 
<? 
// Faço o envio da mensagem, se o formulário for submetido e passar no teste anterior 
elseif(isset($subm)): 
?> 
<div style='padding:10px;'> 
<? 
$msg1 = "<h2><b>Sua mensagem foi enviada com sucesso!</b></h2>"; 
$msg2 = "<h2><b style='color:#e23b30;'>Sua mensagem não pôde ser enviada.</b><br /><br />Por favor tente novamente mais tarde.</h2>"; 
$conf = @mail($__to, $__sj, $html, $head); 
echo ($conf)?$msg1:$msg2; 
?> 
<br /> 
<a href='javascript:history.back(1)'>Clique aqui para retornar!</a> 
</div> 
<? 
// Exibe o formulário para preenchimento 
else: 
?> 
<p>Preencha o formulario abaixo para enviar sua mensagem.<br />Necessario preencher todos os campos.</p> 
<form id="frm" action="<?=basename(__FILE__)?>" method="post" enctype="multipart/form-data"> 
<input type="hidden" name="frm_ok" /> 
<fieldset> 
<legend>Formulario de Contato</legend> 
<p> 
<label for="nome">Nome:</label> 
<input id="nome" name="nome" onKeyDown="if(event.keyCode==13) event.keyCode=9;" /> 
</p> 
<p> 
<label for="email">E-Mail:</label> 
<input id="email" name="email" onKeyDown="if(event.keyCode==13) event.keyCode=9;" /> 
</p> 
<p> 
<label for="telefone">Telefone:</label> 
<input id="telefone" name="telefone" onKeyDown="if(event.keyCode==13) event.keyCode=9;" /> 
</p> 
<p><label for="para">Para:</label> 
<select name="destino" class="texto"> 
<option value="[email protected]" selected>Selecione um Setor</option> 
<option value="[email protected]">Provas</option> 
<option value="[email protected]">Orçamento</option> 
<option value="[email protected]">Administração do Site</option> 
</select> 
<p> 
<label for="mensagem">Anexo #1:</label> 
<input type="file" name="arquivo[]" size="50" class="file" /> 
</p> 
<p> 
<label for="mensagem">Anexo #2:</label> 
<input type="file" name="arquivo[]" size="50" class="file" /> 
</p> 
<p> 
<label for="mensagem">Anexo #3:</label> 
<input type="file" name="arquivo[]" size="50" class="file" /> 
</p> 
<p> 
<label for="mensagem">Mensagem:</label> 
<textarea id="mensagem" name="mensagem" class="text"></textarea> 
</p> 
<p style="text-align:right; padding-right:10px;"> 
<input type="submit" value="ENVIAR" class="send" /> 
</p> 
</fieldset> 
</form> 
<? 
endif; 
?> 
</div> 
</body> 
</html>
						
Thank you Sergio!
– Daniel Gomes
What’s the bug? Already checked if the data is coming to your PHP?
– Sergio Clemente
A friend hinted that it is the PHP version. The one used in my work is 5.3.5. I will have q debug all the code.
– Daniel Gomes
But if anyone can bat their eyes and see what the incompatibilities are, I’d appreciate it!
– Daniel Gomes