Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
Olá pessoal,
estou com um problema com um formulário, ele não quer enviar pro email...
os alerts também não estão rodando. Não sei o que fazer, nem o que está errado.
Segue o código abaixo.
<!--#include file="header.asp"-->
<table width="780" cellpadding="0" cellspacing="0" border="0" bgcolor="#FFFFFF" >
<tr>
<td></td>
<td > </td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td width="7" valign="top"></td>
<td class="texto_cinza_claro">
<p align="center">
<%if request("funcao") = "enviar" then
corpo = "<table border=0 cellpadding=0 cellspacing=0 width=95% align=center>"
corpo = corpo & "<tr><td><FONT face=VERDANA size=2 color=#000000><B>Assunto: </B>" & request.form("assunto") & "</FONT></td></tr><TR><TD height=10></TD></tr>"
corpo = corpo & "<tr><td><FONT face=VERDANA size=2 color=#000000><B>Nome: </B>" & request.form("nome") & "</FONT></td></tr><TR><TD height=10></TD></TR>"
corpo = corpo & "<tr><td><FONT face=VERDANA size=2 color=#000000><B>Email: </B>" & request.form("email") & "</FONT></td></tr><TR><TD height=10></TD>"
corpo = corpo & "<tr><td><FONT face=VERDANA size=2 color=#000000><B>Mensagem: </B>" & request.form("mensagem") & "</FONT></td></tr></table>"
'response.write corpo
Set xMail = Server.CreateObject("Persits.MailSender")
xMail.Host = "www.academiadocerebro.com" 'na dominal
xMail.AddAddress = "ainariel.celebrindal@gmail.com"
xMail.From = request.form("email")
xMail.FromName = request.form("nome")
xMail.Subject = "Fale Conosco - " & request.form("assunto")
xMail.body = corpo
xMail.IsHTML = True
If xMail.Send then%>
<script>
alert("Email enviado com sucesso!!!")
</script>
<%Else
vr_msg = xMail.response%>
<script>
alert("Falha no envio de email.\nErro:<%= vr_msg%>")
</script><%
End Ifend if%>
<script LANGUAGE="JavaScript">
<!--
function Envia(frm) {
if (document.frm.nome.value == ""){
alert("Esqueceu de preencher o seu nome");
document.frm.nome.focus();
return;
}
if (document.frm.email.value == ""){
alert("Esqueceu de preencher o seu email");
document.frm.email.focus();
return;
}
// INICIO VALIDACAO DE EMAIL
if (document.frm.email.value != ""){
prim = document.frm.email.value.indexOf("@")
if(prim < 2) {
alert("O e-mail não está correto.");
document.frm.email.focus();
document.frm.email.select();
return false;
}
if(document.frm.email.value.indexOf("@",prim + 1) != -1) {
alert("O e-mail não está correto.");
document.frm.email.focus();
document.frm.email.select();
return false;
}
if(document.frm.email.value.indexOf(".") < 1) {
alert("O e-mail não está correto.");
document.frm.email.focus();
document.frm.email.select();
return false;
}
if(document.frm.email.value.indexOf(" ") != -1) {
alert("O e-mail não está correto.");
document.frm.email.focus();
document.frm.email.select();
return false;
}
if(document.frm.email.value.indexOf("zipmeil.com") > 0) {
alert("O e-mail não está correto.");
document.frm.email.focus();
document.frm.email.select();
return false;
}
if(document.frm.email.value.indexOf("hotmeil.com") > 0) {
alert("O e-mail não está correto.");
document.frm.email.focus();
document.frm.email.select();
return false;
}
if(document.frm.email.value.indexOf(".@") > 0) {
alert("O e-mail não está correto.");
document.frm.email.focus();
document.frm.email.select();
return false;
}
if(document.frm.email.value.indexOf("@.") > 0) {
alert("O e-mail não está correto.");
document.frm.email.focus();
document.frm.email.select();
return false;
}
if(document.frm.email.value.indexOf(".com.br.") > 0) {
alert("O e-mail não está correto.");
document.frm.email.focus();
document.frm.email.select();
return false;
}
if(document.frm.email.value.indexOf("/") > 0) {
alert("O e-mail não está correto.");
document.frm.email.focus();
document.frm.email.select();
return false;
}
if(document.frm.email.value.indexOf("[") > 0) {
alert("O e-mail não está correto.");
document.frm.email.focus();
document.frm.email.select();
return false;
}
if(document.frm.email.value.indexOf("]") > 0) {
alert("O e-mail não está correto.");
document.frm.email.focus();
document.frm.email.select();
return false;
}
if(document.frm.email.value.indexOf("(") > 0) {
alert("O e-mail não está correto.");
document.frm.email.focus();
document.frm.email.select();
return false;
}
if(document.frm.email.value.indexOf(")") > 0) {
alert("O e-mail não está correto.");
document.frm.email.focus();
document.frm.email.select();
return false;
}
if(document.frm.email.value.indexOf("..") > 0) {
alert("O e-mail não está correto.");
document.frm.email.focus();
document.frm.email.select();
return false;
}
if(document.frm.email.value.indexOf(",") > 0) {
alert("O e-mail não está correto.");
document.frm.email.focus();
document.frm.email.select();
return false;
}
}
// FIM VALIDACAO DE EMAIL
if (document.frm.mensagem.value == ""){
alert("Esqueceu de preencher a mensagem");
document.frm.mensagem.focus();
return;
}
else {
document.frm.submit();
}
}</script>
<form action="fale_conosco.asp? funcao=enviar" name="frm" method="post">
<table border="0" class="texto_cinza_escuro" cellpadding="4" cellspacing="0" align="center">
<tr>
<td><strong>Formulário de Contato</strong></td>
</tr>
<tr>
<td height="1" width="100%" bgcolor="lightblue"></td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td>Nome:<br>
<input type="text" name="nome" size="50" class="formulario"></td>
</tr>
<tr>
<td>Email:<br>
<input type="text" name="email" size="50" class="formulario"></td>
</tr>
<tr>
<td>Assunto:<br>
<select name="assunto" class="formulario">
<option value="Suporte" SELECTED>Selecione o assunto</option>
<option value="Serviços">Serviços</option>
<option value="Cursos Online">Cursos Online</option>
<option value="Dúvidas">Dúvidas</option>
<option value="Outros Assuntos">Outros Assuntos</option>
</select>
</td>
</tr>
<tr>
<td>Mensagem:<br><textarea cols="60" rows="5" name="mensagem" class="formulario"></textarea></td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td><input type="Button" onClick="JavaScript:Envia(frm)" value="Enviar..." class="formulario"></td>
</tr>
<tr>
<td height="10"></td>
</tr>
<tr>
<td height="1" width="100%" bgcolor="lightblue"></td>
</tr>
<tr>
<td height="20"></td>
</tr>
<tr>
<td>Emails: academiadocerebro@hotmail.com / faleconosco@academiadocerebro.com</td>
</tr>
<tr>
<td>Endereço: Rua Santa Luzia nº 405 3º andar sala 17, Centro - Rio de Janeiro</td>
<tr>
<td height="10"></td>
</tr>
<tr>
<td>Telefone: (21) 2220-5372</td>
</tr>
<tr>
<td height="55"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<!--#include file="rodape.asp"-->
Desde já agradeço a ajuda.
Carregando comentários...