Ir para conteúdo
Fórum Script Brasil
  • 0

(Resolvido) Formulario em HTML+ASP+CDOSYS


MLMDesigner

Pergunta

Galera deu um pau aqui q não sei como resolver.... o formulario ta funcionando direitinho se não for preenchido as campo de Nome até Telefone elavai dar as mensagens, mas so tem um problema o e-mail q recebo na minha caixa de mensagem em vez de vir os campos corretos só aparece a palavra false... algume poderia me ajudar a resolver esse problema???/ segue os codigos para vocês darem uma olhada..

Obrigado

Marcelo

Codigo HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	&lt;script language="JavaScript">

   var width = 550;
   var height = 550;

   var left = 100;
   var top = 100;

URL = "http://www.graciinfo.com.br/promocao.jpg";

   window.open(URL,'Natal', 'width='+width+', height='+height+', top='+top+', left='+left+', scrollbars=no, status=no, toolbar=no, location=no, directories=no, menubar=no, resizable=yes, fullscreen=no');

</script>

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>

	<title>GracIInfo Informática - A Sua Empresa Rumo ao Futuro.</title>
	<link rel="stylesheet" href="style.css" type="text/css" charset="utf-8" />

<style type="text/css">
<!--
body {
	background-color: #328CBE;
}
a:link {
	color: #057BB8;
}
.style1 {color: #000000}
a:visited {
	color: #057BB8;
}
a:hover {
	color: #057BB8;
}
a:active {
	color: #057BB8;
}
.style6 {
	font-size: 10px;
	font-weight: bold;
}
#apDiv1 {
	position:absolute;
	left:488px;
	top:64px;
	width:488px;
	height:434px;
	z-index:1;
}
.style8 {color: #057BB8}
.style9 {font-family: Verdana, Arial, Helvetica, sans-serif}
-->
</style></head>

<body>
  <div id="wrapper">
    <div id="header"> </div>
    <div id="left">
      <div id="logo">
        <h1> </h1>
      </div>
      <div id="nav">
        <ul>
          <li class="important"><a href="index.html" class="style1">Home</a></li>
          <li><a href="empresa.html">A Empresa</a></li>
          <li><a href="servicos.html">Serviços</a></li>
          <li><a href="softwares.html">Softwares</a></li>
          <li><a href="localizacao.html">Localização</a></li>
          <li><a href="contato.html">Contato</a></li>
                 </ul>
      </div>
      <div id="news">
        <h2 align="left">Proteu - Sistema de Clínicas</h2> 
        <p align="left"><img src="images/proteu_left.jpg" alt="" width="153" height="86" /></p>
        <p class="more"><span class="style6"><a href="softwares.html">Saiba mais</a></span></p>
        <div class="hr-dots"> </div>
        <h3 align="left">Desenvolvimento e Soluções</h3> 
        <p align="left"><img src="images/oftalmologia_left.jpg" alt="" width="129" height="125" /></p>
        <p align="justify">Desenvolvemos soluções que visam aumentar a competitividade da sua   empresa com o que há de melhor nos campos médico-laboratorial e setor de   clínicas.<br />
        </p>
        <p class="more"><a href="desenvolvimento_solucoes.html" target="_parent">Saiba mais</a></p>
      </div>
      <div id="support">
        <p> </p>
      </div>
    </div>
    <div id="right">
      <h2>Faça seu cadastro e Baixe a Demonstração</h2>
      <div id="welcome">
       <html>
                <head>
                <title>Minha página</title>
                &lt;script type="text/javascript">
                function Confirma() {
                if (document.form1.nomerem.value=="") {
                alert("O campo 'nome' não pode ficar em branco !")
                return false
                }else if (document.form1.emailrem.value=="") {
                alert("Digite seu e-mail !")
                return false
                }else if(document.form1.empresa.value=="") {
                alert("Digite o nome da empresa !")
                return false
				}else if(document.form1.endereço.value=="") {
                alert("Digite o seu endereço !")
                return false
				}else if(document.form1.cidade.value=="") {
                alert("Digite o nome da sua Cidade !")
                return false
				}else if(document.form1.uf.value=="") {
                alert("Digite o nome de seu Estado !")
                return false
				}else if(document.form1.telefone.value=="") {
                alert("Digite o número de seu telefone !")
                return false
				}
                }
                </script>
                </head>
                <form method="post" enctype="multpart/formdata" name="form1" action="enviar.asp" onsubmit="return Confirma()">

			<table width="47%" border="0" cellspacing="2" cellpadding="2">
			<tr>
			<td width="33%"><span class="style9">Nome: </span></td>
			<td width="67%"><font face="Arial, Helvetica, sans-serif" size="2">
			<input type="text" name="nomerem" size="45">
			</font></td>
			</tr>
			<tr>
			<td width="33%"><span class="style9">E-mail: </span></td>
			<td width="67%"><font face="Arial, Helvetica, sans-serif" size="2">
            <input type="text" name="emailrem" size="45">
            </font></td>
            </tr>
            <tr>
            <td width="33%"><span class="style9">Empresa: </span></td>
            <td width="67%"><font face="Arial, Helvetica, sans-serif" size="2">
            <input type="text" name="empresa" size="45">
            </font></td>
            </tr>
            <tr>
            <td width="33%"><span class="style9">Endereço: </span></td>
            <td width="67%"><font face="Arial, Helvetica, sans-serif" size="2">
            <input type="text" name="endereço" size="45">
            </font></td>
            </tr>
            <tr>
            <td width="33%"><span class="style9">Cidade: </span></td>
            <td width="67%"><font face="Arial, Helvetica, sans-serif" size="2">
            <input type="text" name="cidade" size="45">
            </font></td>
            </tr>
            <tr>
            <td width="33%"><span class="style9">UF: </span></td>
            <td width="67%"><font face="Arial, Helvetica, sans-serif" size="2">
            <input type="text" name="uf" size="45">
            </font></td>
            </tr>
            <tr>
            <td width="33%"><span class="style9">Telefone: </span></td>
            <td width="67%"><font face="Arial, Helvetica, sans-serif" size="2">
            <input type="text" name="telefone" size="15">
            </font></td>
            </tr>
            <tr>
            <td width="33%"><span class="style9">Celular: </span></td>
            <td width="67%"><font face="Arial, Helvetica, sans-serif" size="2">
            <input type="text" name="celular" size="15">
            </font></td>
            </tr>
            <tr>
            <td colspan="2">
            <div align="center">
            <input type="submit" name="Submit" value="Enviar">
            <input type="reset" name="reset" value="Limpar">
            </div></td>
            </tr>
            </table>
            </form>
		</div>
        <p align="justify"> </p>

      </div>
      <div id="profile">
        <div> 
		</div>
        <div class="clear"> </div>
        <p class="more"> </p>
      </div>
    </div>
    <div class="clear"> </div>
    <div id="spacer"> </div>
    <div id="footer">
      <div id="copyright">
        Copyright © 2008 GracIInfo Informática - Todos Direitos Reservados.      </div>
	  <div id="footerline"></div>
    </div>

  </div>
  &lt;script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-2567912-1");
pageTracker._trackPageview();
</script>
</body>
&lt;script type="text/javascript">   

/******************************************  
* Snow Effect Script- By Altan d.o.o. (http://www.altan.hr/snow/index.html)  
* Visit Dynamic Drive DHTML code library (http://www.dynamicdrive.com/) for full source code  
* Last updated Nov 9th, 05' by DD. This notice must stay intact for use  

Clubepc.org  
******************************************/  
function openwindow(){   
window.open("autumn_effect.htm","","width=350,height=500")   
}   

//Configure below to change URL path to the snow image   
var snowsrc="6uscqjq.gif"  
// Configure below to change number of snow to render   
var no = 20;   
// Configure whether snow should disappear after x seconds (0=never):   
var hidesnowtime = 0;   
// Configure how much snow should drop down before fading ("windowheight" or "pageheight")   
var snowdistance = "pageheight";   

///////////Stop Config//////////////////////////////////   

var ie4up = (document.all) ? 1 : 0;   
var ns6up = (document.getElementById&&!document.all) ? 1 : 0;   

function iecompattest(){   
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body   
}   

var dx, xp, yp;    // coordinate and position variables   
var am, stx, sty;  // amplitude and step variables   
var i, doc_width = 800, doc_height = 600;   

if (ns6up) {   
doc_width = self.innerWidth;   
doc_height = self.innerHeight;   
} else if (ie4up) {   
doc_width = iecompattest().clientWidth;   
doc_height = iecompattest().clientHeight;   
}   

dx = new Array();   
xp = new Array();   
yp = new Array();   
am = new Array();   
stx = new Array();   
sty = new Array();   
snowsrc=(snowsrc.indexOf("clubepc.org")!=-1)? "snow.gif" : snowsrc   
for (i = 0; i < no; ++ i) {   
dx[i] = 0;                        // set coordinate variables   
xp[i] = Math.random()*(doc_width-50);  // set position variables   
yp[i] = Math.random()*doc_height;   
am[i] = Math.random()*20;         // set amplitude variables   
stx[i] = 0.02 + Math.random()/10; // set step variables   
sty[i] = 0.7 + Math.random();     // set step variables   
if (ie4up||ns6up) {   
if (i == 0) {   
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><a href=\"http://www.clubepc.org\"><img src='"+snowsrc+"' border=\"0\"><\/a><\/div>");   
} else {   
document.write("<div id=\"dot"+ i +"\" style=\"POSITION: absolute; Z-INDEX: "+ i +"; VISIBILITY: visible; TOP: 15px; LEFT: 15px;\"><img src='"+snowsrc+"' border=\"0\"><\/div>");   
}   
}   
}   

function snowIE_NS6() {  // IE and NS6 main animation function   
doc_width = ns6up?window.innerWidth-10 : iecompattest().clientWidth-10;   
doc_height=(window.innerHeight && snowdistance=="windowheight")? window.innerHeight : (ie4up && snowdistance=="windowheight")?  iecompattest().clientHeight : (ie4up && !window.opera && snowdistance=="pageheight")? iecompattest().scrollHeight : iecompattest().offsetHeight;   
for (i = 0; i < no; ++ i) {  // iterate for every dot   
yp[i] += sty[i];   
if (yp[i] > doc_height-50) {   
xp[i] = Math.random()*(doc_width-am[i]-30);   
yp[i] = 0;   
stx[i] = 0.02 + Math.random()/10;   
sty[i] = 0.7 + Math.random();   
}   
dx[i] += stx[i];   
document.getElementById("dot"+i).style.top=yp[i]+"px";   
document.getElementById("dot"+i).style.left=xp[i] + am[i]*Math.sin(dx[i])+"px";   
}   
snowtimer=setTimeout("snowIE_NS6()", 300);   
}   

function hidesnow(){   
if (window.snowtimer) clearTimeout(snowtimer)   
for (i=0; i<no; i++) document.getElementById("dot"+i).style.visibility="hidden"  
}   

if (ie4up||ns6up){   
snowIE_NS6();   
if (hidesnowtime>0)   
setTimeout("hidesnow()", hidesnowtime*1000)   
}   

</script> 
</html>
_____________________________ Codigo ASP
<%
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = Server.CreateObject("CDO.Configuration")

    cdoConfig.Fields.Item(sch & "sendusing") = 2
    cdoConfig.Fields.Item(sch & "smtpauthenticate") = 1
    cdoConfig.Fields.Item(sch & "smtpserver") = "xxxxxxxxxxxxxxxxxx"
    cdoConfig.Fields.Item(sch & "smtpserverport") = 25
    cdoConfig.Fields.Item(sch & "smtpconnectiontimeout") = 30
    cdoConfig.Fields.Item(sch & "sendusername") = "xxxxxxxxxxxxxxxxxxxxxxx" 'conta@seu_dominio
    cdoConfig.Fields.Item(sch & "sendpassword") = "xxxxxxxxxxxxxxxx"
    cdoConfig.fields.update
    Set cdoMessage = Server.CreateObject("CDO.Message")
    Set cdoMessage.Configuration = cdoConfig

        cdoMessage.From = "formulario@graciinfo.com.br" 'ENDEREÇO DE E-MAIL QUE SERÁ EXIBIDO NO FROM DA MENSAGEM
        cdoMessage.To = "formulario@graciinfo.com.br" 'ex: conta@seu_dominio, conta@uol.com.br, conta@hotmail
        cdoMessage.Subject = "Formulario de Contato"

    strBody = "Dados" & vbCrLf & vbCrLf & _
    "Nome:"& Request("nomerem")& vbCrLf & _
    "E-Mail:"& Request("emailrem")& vbCrLf & _
    "Empresa:"& Request("empresa")& vbCrLf & _
    "Endereço:"& Request("endereço")& vbCrLf & _
    "Cidade:"& Request("cidade")& vbCrLf & _
    "UF:"& Request("uf")& vbCrLf & _
    "Telefone:"& Request("telefone")& vbCrLf & _
    "Celular:"& Request("celular")& vbCrLf & _

        strBody = strBody & "."
        cdoMessage.HTMLBody = strBody

    cdoMessage.Send

        Set cdoMessage = Nothing
        Set cdoConfig = Nothing

Response.Redirect("obrigado.html?" & EmailFrom)
%>

Editado por Jonathan Queiroz
Adcionar tag's (Jonathan)
Link para o comentário
Compartilhar em outros sites

4 respostass a esta questão

Posts Recomendados

  • 0

Como havia falado com você por MP, dividi seu tópico e movi um deles para ASP

Mesmo assim, deixo o link para o tópico antigo: http://scriptbrasil.com.br/forum/index.php?showtopic=129527

Veja se a dica do kuroi ajudou !

Outra forma seria fazer assim:

strBody = "Dados" & vbCrLf & vbCrLf & _
"Nome:"& Request("nomerem")& vbCrLf & _
"E-Mail:"& Request("emailrem")& vbCrLf & _
"Empresa:"& Request("empresa")& vbCrLf & _
"Endereço:"& Request("endereço")& vbCrLf & _
"Cidade:"& Request("cidade")& vbCrLf & _
"UF:"& Request("uf")& vbCrLf & _
"Telefone:"& Request("telefone")& vbCrLf & _
"Celular:"& Request("celular")& vbCrLf & _
"."

Link para o comentário
Compartilhar em outros sites

  • 0
Ai Jonathan agora pode colocar como resolvido valeu agora to trecebendo todas as msgs no e-mail corretamente

Infelizmente não posso !

Participo da área de ASP, mas como usuário comum !

Não sou moderador daqui...

Se não me engano são apenas o Rafael e o bareta

Mas não se preocupe, é só esperar que alguém coloca como resolvido aqui^^

Link para o comentário
Compartilhar em outros sites

Participe da discussão

Você pode postar agora e se registrar depois. Se você já tem uma conta, acesse agora para postar com sua conta.

Visitante
Responder esta pergunta...

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emoticons são permitidos.

×   Seu link foi incorporado automaticamente.   Exibir como um link em vez disso

×   Seu conteúdo anterior foi restaurado.   Limpar Editor

×   Você não pode colar imagens diretamente. Carregar ou inserir imagens do URL.



  • Estatísticas dos Fóruns

    • Tópicos
      152,2k
    • Posts
      651,9k
×
×
  • Criar Novo...