Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Fala galera..
sou iniciante.. baixei e instalei o xampp.
depois fui tentar colocar um formulario de email na minha página. Baixei um formail já pronto, que várias pessoas já tinham testado e aprovado, só substituindo o meu email nos devidos lugares. Coloquei numa hospedagem minha da LocaWeb, que dá suporte à PHP 5. Quando deixo de preencher algum campo, retorna a mensagem de erro avisando para preencher. Mas quando está tudo preenchido, aparece:
-no firefox: PHP Warning: mail() [<a href='function.mail'>function.mail</a>]: Failed to connect to mailserver at "smtp.eb.mil.br" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in E:\home\meu_site_principal\web\equipemw\formail.php on line 77
-no internet explorer: HTTP 500 - Erro Interno do servidor
o que eu posso ter feito de errado? eu tenho que instalar alguma coisa na hospedagem? tenho que configurar alguma coisa no xampp?
Conteúdo do formulario.htm:
<!-- INICIO DO CÓDIGO -->
</table>
<form action="formail.php" method="POST">
<font face="Arial Narrow">
<input type="hidden" name="emaildest" value="marcuswaddington@gmail.com"></font>
<font face="Arial Narrow">
<input type="hidden" name="redirecionar" value="[http://www.equipemarcuswaddington.com/msgenviada.htm](http://www.equipemarcuswaddington.com/msgenviada.htm) ">
</font>
<center>
<table width="635" bgcolor="#000000" border="0" align="center" cellspacing="0" cellpadding="1" height="270">
<tr>
<td width="633" height="268">
<div align="center">
<center>
<table width="344" bgcolor="#C4C4AA" border="1" cellspacing="0" cellpadding="3" style="border-collapse: collapse" bordercolor="#111111" height="271">
<tr>
<td width="93" height="22"><font face="Tahoma" size="2">Seu nome:</font></td>
<td width="239" height="22">
<font face="Arial Narrow">
<input type="text" size="70" name="nome" value=""></font></td>
</tr>
<tr>
<td width="93" height="22"><font face="Tahoma" size="2">Seu E-mail:</font></td>
<td width="239" height="22">
<font face="Arial Narrow">
<input type="text" size="70" name="email" value=""></font></td>
</tr>
<tr>
<td width="93" height="22"><font face="Tahoma" size="2">Assunto:</font></td>
<td width="239" height="22">
<font face="Arial Narrow">
<input type="text" size="70" name="assunto" value=""></font></td>
</tr>
<tr>
<td width="93" height="100"><font face="Tahoma" size="2">Mensagem:</font></td>
<td width="239" height="100">
<font face="Arial Narrow">
<textarea cols="60" rows="6" name="mensagem"></textarea></font></td>
</tr>
<tr>
<td colspan="2" align="center" width="331" height="71">
<font face="Arial Narrow">
<input type="submit" value=" Enviar " style="float: left; font-family: Tahoma"></font><font face="Tahoma"><input type="reset" value=" Limpar " style="float: left"></font><font face="Arial Narrow">
</font></td>
</tr>
</table>
</center>
</div>
</td>
</tr>
</table>
</center>
</form>
<p align="center">
<a href="corpo.asp"><strong><font color="#000000" face="Tahoma" size="3">Voltar</font></strong></a></p>
</body><!-- INICIO DO CÓDIGO -->
<?php require "config.ini"; ?>
<?php
ini_set ("SMTP","smtp.eb.mil.br");
////////////////////////////////////////////////
// Formail em PHP por SK15 v 1.0 |||
// Esse formulario é uma imitação do formail |||
// com um pequena ponto fraco |||
// ao adicionar um novo campo ele tera |||
// quer ser mudado aqui nesse arquivo |||
/////////////////////////////////////////////|||
// Carrega dados pelo método POST, independente da configuração das variáveis Globais do ini do PHP
$nome=$_POST["nome"];
$email=$_POST["email"];
$assunto=$_POST["assunto"];
$mensagem=$_POST["mensagem"];
// Verifica se O Campo nome tá preenchido
if (empty($nome)){
// HTML que aparecera o ERRO
echo "<html><head><title>Ocorreu Um ERRO !!!</title></head>";
echo "<body bgcolor=\"#ffffff\">";
echo "<br><br><br>";
echo "<center>É Necessario o Preenchimento do <b>Nome</b></center>";
echo "<br><br><center><a href=\"java script:history.back(1)\">Volta</a></center>";
echo "</body></html>";
}echo "<html><head><title>Ocorreu Um ERRO !!!</title></head>";
echo "<body bgcolor=\"#ffffff\">";
echo "<br><br><br>";
echo "<center>O E-mail não foi <b>Digitado</b></center>";
echo "<br><br><center><a href=\"java script:history.back(1)\">Volta</a></center>";
echo "</body></html>";
}echo "<html><head><title>Ocorreu Um ERRO !!!</title></head>";
echo "<body bgcolor=\"#ffffff\">";
echo "<br><br><br>";
echo "<center>O E-mail <b>Não</b> é <b>válido</b></center>";
echo "<br><br><center><a href=\"java script:history.back(1)\">Volta</a></center>";
echo "</body></html>";
}echo "<html><head><title>Ocorreu Um ERRO !!!</title></head>";
echo "<body bgcolor=\"#ffffff\">";
echo "<br><br><br>";
echo "<center>Você <b>Não</b> Digitou Um <b>Assunto</b></center>";
echo "<br><br><center><a href=\"java script:history.back(1)\">Volta</a></center>";
echo "</body></html>";
}echo "<html><head><title>Ocorreu Um ERRO !!!</title></head>";
echo "<body bgcolor=\"#ffffff\">";
echo "<br><br><br>";
echo "<center>Você <b>Não</b> Digitou Uma <b>Mensagem</b></center>";
echo "<br><br><center><a href=\"java script:history.back(1)\">Volta</a></center>";
echo "</body></html>";
}//mail ("marcuswaddington@gmail.com ","nome","string message", "string additional_headers");
mail ("$emaildest","$assunto","Nome:$nome\n Email:$email\n Mensagem:$mensagem\n IP:$REMOTE_ADDR\n\n ...::: Equipe MarcusWaddington ® :::...","From:$nome<$email>");
}
// HTML do redirecionameto e se não redirecionar aparece um link
echo "<html><head>";
echo "<meta http-equiv=\"refresh\" content=\"0;url=$redirecionar\">";
echo "<title>Redirecionado ...</title>";
echo "</head><body bgcolor=\"#ffffff\">";
echo "<a href=\"$redirecionar\" target=\"_top\">Volta Para O Site</a>";
echo "</body></html>";
}
?>
<!-- FIM DO CODIGO -->
Conteudo do config.ini:
<?php
// Isto é quase como uma chave se você não quiser mais receber mensagems é só colocar 0
// 1 = Ligado - 0 = Desligado
// ...::: BY SK15 ® :::...
$certo="1";
$emaildest="marcuswaddington@gmail.com ";
$redirecionar="http://www.equipemarcuswaddington.com/msgenviada.htm"
?>
O que eu posso ter feito errado??
Grato..
Carregando comentários...