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.
<%
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)
%>
Pergunta
PRISCILA STOCHINI
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
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é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ário para Colaboradores </h2></td> </tr> <tr> <td colspan="4"><p align="center" class="txt">Confirmaçã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ço</strong></div></td> <td><input name="end" type="text" class="formulario" id="end" size="30" maxlength="150"></td> <td width="120"><strong>nº</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"> </td> <td colspan="3"><p><strong>Resumo da Atividade Pretendida: </strong> <TEXTAREA name="ATIVIDADE" cols="76" rows="4"></TEXTAREA> </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"> </p> <p class="style1"> </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.