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

Email...


PRISCILA STOCHINI

Pergunta

Olha eu novamente com o mesmo problema....

Bom, tenho que criar um formulario que envie as informações por email, eu até sei como faz mas não estou conseguindo resolver um problema, primeiro porque não sei qual é o problema e depois porque sou nova em programação...

O problema maior é não estou conseguindo enviar o email em si...cadastrar no Banco, verificar e confirmar eu consigo..só na hora de enviar o email, nada!!!

Vou postar aqui todos os códigos das páginas que vou utilizar, quem puder me ajudar ficarei feliz.

FORMULARIO


<html>
<head>
<title>Formulario consulta t&eacute;cnica</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK href="../../comun/menus.css" rel=STYLESHEET type=text/css>
</head>

<body leftmargin="1">
<form name="consulta_tecnica" method="post" action="confirma.asp">
  <table border="1" cellspacing="0" cellpadding="6" width="865" align="center" bordercolor="#999999">
    <tr> 
      <td colspan="4" bgcolor="#778899"><h2 align="center" class="Estilo1">Formul&aacute;rio para Colaboradores </h2></td>
    </tr>
    <tr> 
      <td colspan="4"> <p class="txt">Os campos 
          marcados com <img src="imagens/obrigatorio.gif" width="18" height="18" align="absmiddle"> 
          s&atilde;o obrigat&oacute;rios. </p>      </td>
    </tr>
    <tr> 
      <td width="108" bgcolor="#CCCCCC" class="rotulo_formulario"> 
      <div align="right"><strong>Empresa</strong></div></td>
      <td colspan="3"><input name="empresa" type="text" class="formulario" id="empresa" size="50" maxlength="150"> <img src="imagens/obrigatorio.gif" width="18" height="18" align="absmiddle"></td>
    </tr>
    <tr>
      <td bgcolor="#CCCCCC" class="rotulo_formulario"><div align="right"><strong>Departamento</strong></div></td>
      <td colspan="3"><input name="depart" type="text" class="formulario" id="depart">
          <img src="imagens/obrigatorio.gif" width="18" height="18" align="absmiddle"></td>
    </tr>
    <tr>
      <td height="37" bgcolor="#CCCCCC" class="rotulo_formulario"><div align="right"><strong>Contato</strong></div></td>
      <td width="245"><input name="contato" type="text" class="formulario" id="contato">
          <img src="imagens/obrigatorio.gif" width="18" height="18" align="absmiddle"></td>
      <td colspan="2"><strong>Cargo </strong>
        <input name="cargo" type="text" class="formulario" id="cargo">
        <img src="imagens/obrigatorio.gif" width="18" height="18" align="absmiddle"></td>
    </tr>
    <tr>
      <td bgcolor="#CCCCCC" class="rotulo_formulario"><div align="right"><strong>Endere&ccedil;o</strong></div></td>
      <td><input name="end" type="text" class="formulario" id="end" size="30" maxlength="150">
          <img src="imagens/obrigatorio.gif" width="18" height="18" align="absmiddle"></td>
      <td width="120"><strong>n&ordm;</strong> 
      <input name="num" type="text" class="formulario" id="num" size="8" maxlength="10"></td>
      <td width="334"><strong>Compl. 
        <input name="compl" type="text" class="formulario" id="compl" size="10" maxlength="10">
      </strong></td>
    </tr>
    <tr>
      <td bgcolor="#CCCCCC" class="rotulo_formulario"><div align="right"><strong>CEP</strong></div></td>
      <td><input name="cep" type="text" class="formulario" id="cep" size="18" maxlength="9"> 
      <img src="imagens/obrigatorio.gif" width="18" height="18" align="absmiddle"></td>
      <td><strong>UF:
          <label>
          <select name="estado" size="1" class="formulario" id="estado">
            <option value="AC">AC</option>
            <option value="AL">AL</option>
            <option value="AP">AP</option>
            <option value="AM">AM</option>
            <option value="BA">BA</option>
            <option value="CE">CE</option>
            <option value="DF">DF</option>
            <option value="ES">ES</option>
            <option value="GO">GO</option>
            <option value="MA">MA</option>
            <option value="MG">MG</option>
            <option value="MS">MS</option>
            <option value="muito">muito</option>
            <option value="pra">pra</option>
            <option value="PB">PB</option>
            <option value="PE">PE</option>
            <option value="PI">PI</option>
            <option value="PR">PR</option>
            <option value="RJ">RJ</option>
            <option value="RO">RO</option>
            <option value="RN">RN</option>
            <option value="RR">RR</option>
            <option value="RS">RS</option>
            <option value="SC">SC</option>
            <option value="SE">SE</option>
            <option value="SP">SP</option>
            <option value="TO">TO</option>
          </select>
          </label>
      </strong></td>
      <td><strong>Cidade:</strong>
        <input name="cidade" type="text" class="formulario" id="cidade" size="20" maxlength="150"></td>
    </tr>
    <tr>
      <td bgcolor="#CCCCCC" class="rotulo_formulario"><div align="right"><strong>DDD</strong></div></td>
      <td colspan="3"><pre><span class="style2"><input name="ddd" type="text" class="formulario" id="ddd" size="10" maxlength="10"> </span><span class="style3"><span class="style4">Telefone: </span><input name="tel" type="text" class="formulario" id="tel" size="18" maxlength="9"><img src="imagens/obrigatorio.gif" width="18" height="18" align="absmiddle">  <span class="style4">Fax: <input name="fax" type="text" class="formulario" id="fax" size="18" maxlength="9">  Cel:</span><input name="cel" type="text" class="formulario" id="cel" size="18" maxlength="9"></span></pre></td>
    </tr>
    <tr>
      <td bgcolor="#CCCCCC" class="rotulo_formulario"><div align="right"><strong>E-mail</strong></div></td>
      <td colspan="3"><input name="correio_eletronico" type="text" class="formulario" id="correio_eletronico" size="40">
          <img src="imagens/obrigatorio.gif" width="18" height="18" align="absmiddle"> <strong>Home Page
          <input name="homepage" type="text" class="formulario" id="homepage" size="40">
          </strong></td>
    </tr>
    <tr>
      <td bgcolor="#CCCCCC" class="rotulo_formulario">&nbsp;</td>
      <td colspan="3"><p><strong>Resumo da   Atividade Pretendida: </strong>
        <TEXTAREA name="ATIVIDADE" cols="76" rows="4"></TEXTAREA>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
      </td>
    </tr>
  </table>
  <p align="center"><br><input name="Enviar" type="submit" class="formulario" value="Enviar">
     <input name="Apagar" type="reset" class="formulario" id="Apagar" value="Apagar Dados">
  </p>
  <blockquote>&nbsp;</blockquote>
</form>
<hr width="90%" size="1" noshade color="#000000">
<p>&nbsp;</p>
</body>
</html>
CONFIRMACAO DOS DADOS
<% 
Vempresa = Request.Form("empresa")
Vdepart = Request.Form("depart")
Vcontato = Request.Form("contato")
Vcargo = Request.Form("cargo")
%>
<html>
<head>
<title>Formulario consulta t&eacute;cnica</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
h2 {
    color: #FFFFFF;
    font-weight: bold;
}
.txtRojo {color: #990000}
body, td, th {
    font-family: Arial, Helvetica, sans-serif;
}
body {
    background-image: url('Consultas/fundo.jpg');
}
.style2 {    font-size: 16px;
    font-weight: bold;
    font-family: Arial, Helvetica, sans-serif;
}
.style3 {font-family: Arial, Helvetica, sans-serif; font-weight: bold;}
.style4 {font-size: 16px}
.style7 {font-size: 12px}
.style9 {font-size: 18px}
-->
</style>
</head>

<body leftmargin="1">
<form method="post" action="enviando.asp">
<table border="1" cellspacing="0" cellpadding="6" width="865" align="center" bordercolor="#999999">
  <tr>
    <td colspan="4" bgcolor="#778899"><h2 align="center" class="Estilo1">Formul&aacute;rio para Colaboradores </h2></td>
  </tr>
  <tr>
    <td colspan="4"><p align="center" class="txt">Confirma&ccedil;&atilde;o dos DADOS </p></td>
  </tr>
  <tr>
    <td width="108" bgcolor="#CCCCCC" class="rotulo_formulario"><div align="right"><strong>Empresa</strong></div></td>
    <td colspan="3"><strong><%=Vempresa%></strong><input name="empresa" type="hidden" class="formulario" id="empresa" size="50" maxlength="150" value="<%=Vempresa%>"></td>
  </tr>
  <tr>
    <td bgcolor="#CCCCCC" class="rotulo_formulario"><div align="right"><strong>Departamento</strong></div></td>
    <td colspan="3"> <strong><%=Vdepart%></strong><input name="depart" type="hidden" class="formulario" id="depart" value="<%=Vdepart%>"></td>
  </tr>
  <tr>
    <td height="37" bgcolor="#CCCCCC" class="rotulo_formulario"><div align="right"><strong>Contato</strong></div></td>
    <td width="245"><input name="contato" type="text" class="formulario" id="Contato" value="<%=Vcontato%>"></td>
    <td colspan="2"><strong>Cargo </strong>
        <input name="cargo" type="text" class="formulario" id="cargo" value="<%=Vcargot%>"></td>
  </tr>
  <tr>
    <td bgcolor="#CCCCCC" class="rotulo_formulario"><div align="right"><strong>Endere&ccedil;o</strong></div></td>
    <td><input name="end" type="text" class="formulario" id="end" size="30" maxlength="150"></td>
    <td width="120"><strong>n&ordm;</strong>
        <input name="num" type="text" class="formulario" id="num" size="8" maxlength="10"></td>
    <td width="334"><strong>Compl.
      <input name="compl" type="text" class="formulario" id="compl" size="10" maxlength="10">
    </strong></td>
  </tr>
  <tr>
    <td bgcolor="#CCCCCC" class="rotulo_formulario"><div align="right"><strong>CEP</strong></div></td>
    <td><input name="cep" type="text" class="formulario" id="cep" size="18" maxlength="9"></td>
    <td><strong>UF:
      <label>
          <select name="estado" size="1" class="formulario" id="estado">
            <option value="AC">AC</option>
            <option value="AL">AL</option>
            <option value="AP">AP</option>
            <option value="AM">AM</option>
            <option value="BA">BA</option>
            <option value="CE">CE</option>
            <option value="DF">DF</option>
            <option value="ES">ES</option>
            <option value="GO">GO</option>
            <option value="MA">MA</option>
            <option value="MG">MG</option>
            <option value="MS">MS</option>
            <option value="muito">muito</option>
            <option value="pra">pra</option>
            <option value="PB">PB</option>
            <option value="PE">PE</option>
            <option value="PI">PI</option>
            <option value="PR">PR</option>
            <option value="RJ">RJ</option>
            <option value="RO">RO</option>
            <option value="RN">RN</option>
            <option value="RR">RR</option>
            <option value="RS">RS</option>
            <option value="SC">SC</option>
            <option value="SE">SE</option>
            <option value="SP">SP</option>
            <option value="TO">TO</option>
          </select>
          </label>
    </strong></td>
    <td><strong>Cidade:</strong>
        <input name="cidade" type="text" class="formulario" id="cidade" size="20" maxlength="150"></td>
  </tr>
  <tr>
    <td bgcolor="#CCCCCC" class="rotulo_formulario"><div align="right"><strong>DDD</strong></div></td>
    <td colspan="3"><pre><span class="style2"><input name="ddd" type="text" class="formulario" id="ddd" size="10" maxlength="10"> </span><span class="style3"><span class="style4">Telefone: </span><input name="tel" type="text" class="formulario" id="tel" size="18" maxlength="9"><span class="style4">Fax: <input name="fax" type="text" class="formulario" id="fax" size="18" maxlength="9">  Cel:</span><input name="cel" type="text" class="formulario" id="cel" size="18" maxlength="9"></span></pre></td>
  </tr>
  <tr>
    <td bgcolor="#CCCCCC" class="rotulo_formulario"><div align="right"><strong>E-mail</strong></div></td>
    <td colspan="3"><input name="email" type="text" class="formulario" id="email" size="40">
    <strong>Home Page
          <input name="homepage" type="text" class="formulario" id="homepage" size="40">
      </strong></td>
  </tr>
  <tr>
    <td bgcolor="#CCCCCC" class="rotulo_formulario">&nbsp;</td>
    <td colspan="3"><p><strong>Resumo da   Atividade Pretendida: </strong>
            <TEXTAREA name="ATIVIDADE" cols="76" rows="4"></TEXTAREA>
      &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p></td>
  </tr>
</table>
<p align="center">
  <input name="button" type="button" style="background-color:#fff; border:1px; border-color:#C8C8C8; cursor:hand; font-size:14px" OnClick= "voltar()" value="[ Corrigir ]" >
  <input name="submit" type="submit" style="background-color:#fff; border:1px; border-color:#C8C8C8; cursor:hand; font-size:14px" value="[ Confirmar ]">
</p>
</form>
<script javascript>
function voltar(){
history.back(-1)
}
</script>

<hr width="90%" size="1" noshade color="#000000">
</body>
</html>
CONECTANDO O BANCO
<%
Sub AbreConn
    
    Dim bco, sql, rs

Set bco = server.CreateObject("ADODB.connection")
bco.open("driver={Microsoft Access Driver (*.mdb)}; DBQ=usuarios.mdb")

End Sub
'-----------------------------
Sub FechaConn
    bco.close
    Set bd = Nothing
End sub
%>
ENVIANDO OS DADOS
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
'recupera os valores
Vempresa = Request.Form("empresa")
Vdepart = Request.Form("depart")

'Monta Mensagem
HTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">"
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<meta http-equiv=""Content-Type""" 
HTML = HTML & "content=""text/html; charset=iso-8859-1"">" 
HTML = HTML & "<title>Contatos </title>" 
HTML = HTML & "</head>" 
HTML = HTML & "<body bgcolor=""#FFFFFF"">"
HTML = HTML & "<font size=""1"" face=""verdana"">"
HTML = HTML & "<B>CONTATOS XXXXXX</B><BR><HR><BR>"
HTML = HTML & "<B>EMPRESA : </B>" & Vempresa & "<BR>"
HTML = HTML & "<B>DEPARTAMENTO : </B>" & Vdepart & "<BR>"
HTML = HTML & "</body>"
HTML = HTML & "</html>"

'Chamamos o componente e enviamos o email
Set myMail = CreateObject("CDONTS.NewMail") 
myMail.From = "teste@cype.com.br" 
myMail.To = "suporte_parceiros@multiplus.com"
myMail.Subject = "EMAIL DE TESTE DOS FORMULARIOS & Vempresa "
myMail.BodyFormat = 0 
myMail.MailFormat = 0 
myMail.Body = HTML 
myMail.Send 

Set myMail = Nothing 

URL = "cadastrando.asp"
response.redirect(URL) 

%>
CONFIRMANDO ENVIO
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
.style1 {
    font-size: 36px;
    font-weight: bold;
    font-family: "Times New Roman", Times, serif;
}
.style2 {font-size: 36px; font-weight: bold; font-family: "Times New Roman", Times, serif; color: #FF0000; }
.style3 {color: #0000FF}
-->
</style>
</head>

<body>
<div align="center">
  <p class="style1">&nbsp;</p>
  <p class="style1">&nbsp;</p>
  <p class="style2 style3">CADASTRO REALIZADO COM SUCESSO!!!!!!      </p>
</div>
<%Response.AddHeader "refresh","1;url=http://www.cype.com.br"%>
</body>
</html>

Quem puder me ajudar, ficarei feliz...

Link para o comentário
Compartilhar em outros sites

4 respostass a esta questão

Posts Recomendados

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...