Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Ewerton93

email com problema

Recommended Posts

ola me ajudem pois num faz nada nem dar erro e nem manda nada para o email http://forum.imasters.com.br/public/style_emoticons/default/assobiando.gif

 

 

 

ASP
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<!--#include file="cp/conexao.asp" -->

<%

opc = Request.Form("opc")

nome = Request.Form("nome")

email = Request.Form("email")

se1 = Request.Form("se1")

se2 = Request.Form("se2")

se3 = Request.Form("se3")

se4 = Request.Form("se4")

se5 = Request.Form("se5")

se6 = Request.Form("se6")

se7 = Request.Form("se7")

se8 = Request.Form("se8")

se9 = Request.Form("se9")

se10 = Request.Form("se10")

se11= Request.Form("se11")

se12 = Request.Form("se12")

qdt = Request.Form("qdt")

texto = Request.Form("texto")

'aqui conexao com o banco de dados

Set Database = Server.CreateObject("ADODB.Connection")

Database.open = strcon

'aqui envia o email

Set EnviarMail = Server.CreateObject("CDONTS.NewMail")

if Request.Form("opc") = "I" then

EnviarMail.To = "email"

EnviarMail.CC = "emails"

EnviarMail.From =  email

EnviarMail.Subject = "Cotação Online"

HTML = "<html>"

HTML = HTML & "<head>"

HTML = HTML & "<meta http-equiv=""Content-Type"""

HTML = HTML & "content=""text/html; charset=iso-8859-1"">"

HTML = HTML & "<title>Titulo do E-mail</title>"

HTML = HTML & "</head>"

HTML = HTML & "<body bgcolor=""#FFFFFF"">"

HTML = HTML & "<p align=""center""><font face=""Verdana, Arial, Helvetica, sans-serif"" size=""2"">Olá meu Nome é: <b>" & nome & "</b>, e meu email e <b>" & email & "</b> e estou solicitando as seguintes peças: <b>" & se1 & "</b>,<br> <b>" & se2 & "</b>,<br><b>" & se3 & "</b>,<br><b>" & se4 & "</b>,<br><b>" & se5 & "</b>,<br><b>" & se6 & "</b>,<br><b>" & se7 & "</b>,<br><b>" & se8 & "</b>,<br><b>" & se9 & "</b>,<br><b>" & se10 & "</b>,<br><b>" & se11 & "</b>,<br><b>" & se12 & "</b>,<br> na Quantidade <b>" & qdt & "</b> e nas seguintes observações: <b>" & texto & "</b><br> Agradeço desde de já:<br>Obrigado(a).</font>"

HTML = HTML & "</body>"

HTML = HTML & "</html>"

EnviarMail.Body = HTML

EnviarMail.Importance = 2

EnviarMail.BodyFormat = 0

EnviarMail.MailFormat = 0

EnviarMail.Send

Set EnviarMail = Nothing 'aqui é o fim do email

response.write("<script language='javascript'>alert('O E-mail foi enviado com sucesso!');</script>")  

end if

%>

<script>

function submeter1()

{

        if (form1.nome.value == "")

     {

           alert('O campo Nome não aceita valor em branco!');

           form1.nome.focus();

           return false;

        }

        if (form1.Email.value == "")

     {

           alert('O campo Email não aceita valor em branco!');

           form1.Email.focus();

           return false;

        }

        if (form1.se1.value == "")

     {

           alert('O campo não aceita valor em branco!');

        return false;

        }

        if (form1.se2.value == "")

     {

           alert('O campo não aceita valor em branco!');

           return false;

        }

        if (form1.se3.value == "")

     {

           alert('O campo não aceita valor em branco!');

           return false;

        }

        if (form1.se4.value == "")

     {

           alert('O campo não aceita valor em branco!');

           return false;

        }

        if (form1.se5.value == "")

     {

           alert('O campo não aceita valor em branco!');

           return false;

        }

        if (form1.se6.value == "")

     {

           alert('O campo não aceita valor em branco!');

           return false;

        }

        if (form1.se7.value == "")

     {

           alert('O campo não aceita valor em branco!');

           return false;

        }

        if (form1.se8.value == "")

     {

           alert('O campo não aceita valor em branco!');

           return false;

        }

        if (form1.se9.value == "")

     {

           alert('O campo não aceita valor em branco!');

           return false;

        }

        if (form1.se10.value == "")

     {

           alert('O campo não aceita valor em branco!');

           return false;

        }

        if (form1.se11.value == "")

     {

           alert('O campo não aceita valor em branco!');

           return false;

        }

        if (form1.se12.value == "")

     {

           alert('O campo não aceita valor em branco!');

           return false;

        }

        if (form1.qdt.value == "")

     {

           alert('O campo não aceita valor em branco!');

           return false;

        }

        if (form1.texto.value == "")

     {

           alert('O campo não aceita valor em branco!');

           form1.texto.focus();

           return false;

        }

        else

        {

          if (form1.enviar.value == "Enviar")

           {

                  form1.opc.value = 'I';

                  form1.submit();

                  return;

           }

   }

}

</script>

<html>

<head>

        <title>Cotação Online</title>

        <link rel="stylesheet" type="text/css" href="css/estilo.css">

</head>

<body leftmargin=0 topmargin=0 marginheight="0" marginwidth="0" style="margin:0; word-spacing:0">

<form name="form1" method="post" enctype="multipart/form-data">

<input name="opc" type="hidden" value="">

<table border="0" cellpadding="0" cellspacing="0" width="758" align="center">

<tr>

        <td>

<table width="758" border="0" align="center" cellpadding="0" cellspacing="0">

<tr>

                        <td colspan="2"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="758" height="120">

                                <param name="movie" value="flash/topo/topo.swf">

                                <param name=quality value=high>

                                <embed src="flash/topo/topo.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="758" height="120"></embed>

                          </object></td>

</tr>

<tr>

        <td background="images/fon_top01.jpg" width="758" colspan="2" height="33"><table width="100%" border="0" cellspacing="0" cellpadding="0">

                                <tr>

                                  <td class="b01"><div align="center"><a href="principal.asp">Home</a></div></td>

                                  <td class="b01"><div align="center"><a href="map.asp">Localização</a></div></td>

                                  <td class="b01"><div align="center"><a href="parceria.asp">Parcerias</a></div>

                                        </a></td>

                                  <td class="b01"><div align="center"><a href="clientes.asp">Clientes</a></div></td>

                                  <td class="b01"><div align="center"><a href="">Contatos</a></div></td>

                                  <td class="b01"><div align="center"><a href="">Promoção</a></div></td>

                                </tr>

                          </table>

        </td>

</tr>

</table>

        </td>

</tr>

</table>

<table border="0" cellpadding="0" cellspacing="0" width="754" align="center">

<tr valign="top">

        <td width="190">

<table border="0" cellpadding="0" cellspacing="0" background="images/fon_left01.gif" width="100%">

<tr>

        <td align="right">

<table border="0" cellpadding="0" cellspacing="0" width="165" background="images/fon_left02.gif">

<tr>

        <td background="images/left01.gif" height="26"><p class="title">Clientes</p></td>

</tr>

<tr>

        <td><p class="b01"><img src="images/e02.gif" width="6" height="5" alt="" border="0" align="absmiddle">  <a href="apresentacao.asp">Apresentação</a></p><div align="center"><img src="images/hr01.gif" width="137" height="3" alt="" border="0"></div>

<p class="b01"><img src="images/e02.gif" width="6" height="5" alt="" border="0" align="absmiddle">  <a href="map.asp">Localização</a></p><div align="center"><img src="images/hr01.gif" width="137" height="3" alt="" border="0"></div>

<p class="b01"><img src="images/e02.gif" width="6" height="5" alt="" border="0" align="absmiddle">  <a href="">Pesquisa</a></p><div align="center"><img src="images/hr01.gif" width="137" height="3" alt="" border="0"></div>

<p class="b01"><img src="images/e02.gif" width="6" height="5" alt="" border="0" align="absmiddle">  <a href="parceria.asp">Parcerias</a></p><div align="center"><img src="images/hr01.gif" width="137" height="3" alt="" border="0"></div>

<p class="b01"><img src="images/e02.gif" width="6" height="5" alt="" border="0" align="absmiddle">  <a href="clientes.asp">Clientes</a></p><div align="center"><img src="images/hr01.gif" width="137" height="3" alt="" border="0"></div>

<p class="b01"><img src="images/e02.gif" width="6" height="5" alt="" border="0" align="absmiddle">  <a href="">Contatos</a></p><div align="center"><img src="images/hr01.gif" width="137" height="3" alt="" border="0"></div>

<p class="b01"><img src="images/e02.gif" width="6" height="5" alt="" border="0" align="absmiddle">  <a href="">Promoção</a></p><div align="center"><img src="images/hr01.gif" width="137" height="3" alt="" border="0"></div>

<p class="b01"><img src="images/e02.gif" width="6" height="5" alt="" border="0" align="absmiddle">  <a href="">Comercial</a></p><div align="center"><img src="images/hr01.gif" width="137" height="3" alt="" border="0"></div>

<p class="b01"><img src="images/e02.gif" width="6" height="5" alt="" border="0" align="absmiddle">  <a href="">Assisténcia Técnica</a></p><div align="center"><img src="images/hr01.gif" width="137" height="3" alt="" border="0"></div>

<p class="b01"><img src="images/e02.gif" width="6" height="5" alt="" border="0" align="absmiddle">  <a href="">Fale Conosco</a></p><div align="center"><img src="images/hr01.gif" width="137" height="3" alt="" border="0"></div>     </td>

</tr>

<tr>

        <td><img src="images/left_bot02.gif" width="165" height="18" alt="" border="0"></td>

</tr>

</table>       

<br>

<table border="0" cellpadding="0" cellspacing="0" width="165" background="images/fon_left02.gif">

<tr>

        <td background="images/left02.gif" height="26"><p class="title">PROCURA</p></td>

</tr>

<tr>

        <td>

<p class="px5">

<div align="center"><input type="Text" name="" size="13"></div>

<p class="px5">

<div align="center"><input type="Image" src="images/b_search.gif" width="79" height="20" alt="" border="0"></div>

                                        <p class="px5"></td>

</tr>

<tr>

        <td><img src="images/left_bot02.gif" width="165" height="18" alt="" border="0"></td>

</tr>

</table>        </td>

</tr>

<tr></tr>

</table>

                <img src="images/left_bot01.gif" width="185" height="18" alt="" border="0"></td>

        <td bgcolor="#979797"><img src="images/px1.gif" width="1" height="1" alt="" border="0"></td>

        <td bgcolor="#FFFFFF" width="572">

<div align="center"><img src="images/m_top.gif" width="572" alt="" border="0"></div>

<p class="px5">

<table border="0" cellpadding="0" cellspacing="0" width="95%" align="center" height="25" background="images/fon_bar01.gif">

<tr>

        <td>

<table border="0" cellpadding="0" cellspacing="0" background="" bgcolor="#FFFFFF">

<tr>

        <td><img src="images/e04.gif" width="21" height="21" alt="" border="0" align="left"></td>

        <td><p class="bar01" style="color: #3466DE; font-size: 18px;">Cotação Microcomputador </p></td>

</tr>

</table>        </td>

</tr>

</table>

<br>

<table width="100%" border="0" cellspacing="0" cellpadding="0">

  <tr>

        <td>

        <table width="100%" border="0" cellspacing="0" cellpadding="0">

          <tr>

                <td width="5%"> </td>

                <td width="21%" class="left"><b> Nome:</b></td>

                <td width="74%" class="menu01"><input name="nome" size="30" type="text"></td>

          </tr>

          <tr>

          <tr>

                <td width="5%"> </td>

                <td width="21%" class="left"><b> Email:</b></td>

                <td width="74%" class="menu01"><input name="Email" size="30" type="text"></td>

          </tr>

          <tr>

                <td width="5%"> </td>

                <td width="21%" class="left"><b>Gabinete:</b></td>

                <td width="74%" class="menu01"><select name="se1">

                <option>selecione</option>

                        <%

                        sqlpe = "SELECT codgabinete,gabinete FROM tgabinete order by gabinete"

                        set rspe = Database.execute(sqlpe)

                        while not rspe.EOF

                        response.write("<option value=" & rspe("gabinete") & ">" & rspe("gabinete")&" </option>")

                        rspe.movenext()

                        wend

                        %>

                </select>            </td>

          </tr>

          <tr>

                <td> </td>

                <td class="left"><b>Processador:</b></td>

                <td class="menu01">

                <select name="se2">

                <option>selecione</option>

                   <%

                        sqlpe = "SELECT codcpu,processador FROM tprocessador order by processador"

                        set rspe = Database.execute(sqlpe)

                        while not rspe.EOF

                        response.write("<option value=" & rspe("processador") & ">" & rspe("processador")&" </option>")

                        rspe.movenext()

                        wend

                   %>

                </select>             </td>

          </tr>

          <tr>

                <td> </td>

                <td class="left"><b>Placa mãe:</b></td>

                <td class="menu01"><select name="se3">

                  <option>selecione</option>

                  <%

                        sqlpe = "SELECT codplacamae,placamae FROM tplacamae order by placamae"

                        set rspe = Database.execute(sqlpe)

                        while not rspe.EOF

                        response.write("<option value=" & rspe("placamae") & ">" & rspe("placamae")&" </option>")

                        rspe.movenext()

                        wend

                        %>

                </select></td>

          </tr>

          <tr>

                <td> </td>

                <td class="left"><b>Placa vídeo</b></td>

                <td class="menu01"><select name="se4">

                <option>selecione</option>

                   <%

                        sqlpe = "SELECT codplacavideo,placavideo FROM tplacavideo order by placavideo"

                        set rspe = Database.execute(sqlpe)

                        while not rspe.EOF

                        response.write("<option value=" & rspe("placavideo") & ">" & rspe("placavideo")&" </option>")

                        rspe.movenext()

                        wend

                        %>

                </select>            </td>

          </tr>

          <tr>

                <td> </td>

                <td class="left"><b>Modem:</b></td>

                <td class="menu01"><select name="se5">

                <option>selecione</option>

                   <%

                        sqlpe = "SELECT codmodem,modem FROM tmodem order by modem"

                        set rspe = Database.execute(sqlpe)

                        while not rspe.EOF

                        response.write("<option value=" & rspe("modem") & ">" & rspe("modem")&" </option>")

                        rspe.movenext()

                        wend

                        %>             

                </select>            </td>

          </tr>

          <tr>

                <td> </td>

                <td class="left"><b>Placa de rede:</b> </td>

                <td class="menu01">

                  <select name="se6">

                  <option>selecione</option>

                         <%

                        sqlpe = "SELECT codrede,placarede FROM tplacarede order by placarede"

                        set rspe = Database.execute(sqlpe)

                        while not rspe.EOF

                        response.write("<option value=" & rspe("placarede") & ">" & rspe("placarede")&" </option>")

                        rspe.movenext()

                        wend

                        %>

                  </select>          </td>

          </tr>

          <tr>

                <td> </td>

                <td class="left"><b>Hard disk</b></td>

                <td class="menu01"><select name="se7">

                <option>selecione</option>

                                         <%

                        sqlpe = "SELECT codhd,harddisk FROM tharddisk order by harddisk"

                        set rspe = Database.execute(sqlpe)

                        while not rspe.EOF

                        response.write("<option value=" & rspe("harddisk") & ">" & rspe("harddisk")&" </option>")

                        rspe.movenext()

                        wend

                        %>

                </select>            </td>

          </tr>

          <tr>

                <td> </td>

                <td class="left"><b>Disquete:</b></td>

                <td class="menu01"><select name="se8">

                <option>selecione</option>

                         <%

                        sqlpe = "SELECT coddis,disquete FROM tdisquete order by disquete"

                        set rspe = Database.execute(sqlpe)

                        while not rspe.EOF

                        response.write("<option value=" & rspe("disquete") & ">" & rspe("disquete")&" </option>")

                        rspe.movenext()

                        wend

                        %>

                </select>            </td>

          </tr>

          <tr>

                <td> </td>

                <td class="left"><b>Drivers:</b></td>

                <td class="menu01"><select name="se9">

                <option>selecione</option>

                        <%

                        sqlpe = "SELECT coddrivers,drivers FROM tdrivers order by drivers"

                        set rspe = Database.execute(sqlpe)

                        while not rspe.EOF

                        response.write("<option value=" & rspe("drivers") & ">" & rspe("drivers")&" </option>")

                        rspe.movenext()

                        wend

                        %>

                </select>            </td>

          </tr>

          <tr>

                <td> </td>

                <td class="left"><b>Teclado:</b></td>

                <td class="menu01">

                <select name="se10">

                <option>selecione</option>

                        <%

                        sqlpe = "SELECT codteclado,teclado FROM tteclado order by teclado"

                        set rspe = Database.execute(sqlpe)

                        while not rspe.EOF

                        response.write("<option value=" & rspe("teclado") & ">" & rspe("teclado")&" </option>")

                        rspe.movenext()

                        wend

                        %>

           </select>            </td>

                </tr>

                <tr>

                <td> </td>

                <td class="left"><b>Mouse:</b></td>

                <td class="menu01">

                <select name="se11">

                <option>selecione</option>

                        <%

                        sqlpe = "SELECT codmouse,mouse FROM tmouse order by mouse"

                        set rspe = Database.execute(sqlpe)

                        while not rspe.EOF

                        response.write("<option value=" & rspe("mouse") & ">" & rspe("mouse")&" </option>")

                        rspe.movenext()

                        wend

                        %>

                </select>            </td>

                   </tr>

                          <tr>

                <td> </td>

                <td class="left"><b>Sistema Operacional:</b></td>

                <td class="menu01">

                <select name="se11">

                <option>selecione</option>

                        <%

                        sqlpe = "SELECT codsist,sistoperac FROM tsistemaoperacional order by sistoperac"

                        set rspe = Database.execute(sqlpe)

                        while not rspe.EOF

                        response.write("<option value=" & rspe("sistoperac") & ">" & rspe("sistoperac")&" </option>")

                        rspe.movenext()

                        wend

                        %>

                </select>            </td>

                        </tr>

                <tr>

                <td> </td>

                <td class="left"><b>Monitor:</b></td>

                <td class="menu01"><select name="se12">

                        <option>selecione</option>

                        <%

                        sqlpe = "SELECT codmonitor,monitor FROM tmonitor order by monitor"

                        set rspe = Database.execute(sqlpe)

                        while not rspe.EOF

                        response.write("<option value=" & rspe("monitor") & ">" & rspe("monitor")&" </option>")

                        rspe.movenext()

                        wend

                        %>

                </select>            </td>

                        </tr>

                        <tr>

                <td> </td>

                <td class="left"><b>Cor:</b></td>

                <td class="menu01">

                <select name="se12">

                <option>selecione</option>

                        <%

                        sqlpe = "SELECT codcor,cor FROM tcor order by cor"

                        set rspe = Database.execute(sqlpe)

                        while not rspe.EOF

                        response.write("<option value=" & rspe("cor") & ">" & rspe("cor")&" </option>")

                        rspe.movenext()

                        wend

                        %>

                </select>            </td>

                   </tr>

                <tr>

                <td> </td>

                <td class="left"><b>Quantidade:</b></td>

                <td><input name="qdt" size="30" type="text"></td>

                        </tr>

                        <tr>

                <tr>

                <td> </td>

                <td class="left" valign="top"><b>obs:</b></td>

                <td><textarea name="texto" cols="45" rows="5"></textarea></td>

                 </tr>

                     <tr>

                <td> </td>

                <td> </td>

                <td><input type="button" onClick="return submeter1();" name="enviar" value="Enviar">

                        </td>

                     </tr>

        </table>

        </td>

  </tr>

</table>

<br>

        <td bgcolor="#979797"><img src="images/px1.gif" width="1" height="1" alt="" border="0"></td>

</tr>

</table>

<table border="0" cellpadding="0" cellspacing="0" width="758" align="center">

<tr>

          <td height="45" align="right" background="images/bot.gif">

                <table border="0" cellpadding="0" cellspacing="0" width="530" background="">

<tr>

        <td>

<p align="center" class="menu02"> <a href="principal.asp">Home</a>    

                                       <a href="">Comercial</a>      

                                <a href="">Promoção</a>      

                        <a href="">Fale Conosco</a>       <a href="">Helpdesk</a>                         </p>  </td>

</tr>

</table>

        </td>

</tr>

<tr>

        <td><p align="right" style="margin-right: 200px;">Telemática 2007 Telematicaes.com.br</p></td>

</tr>

</table>

</form>

</body>

</html>

<%

        Database.close  

       

%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

Ola,Se voce utiliza o windows2003 eu recomendo usar o seguinte:<%Set objCDOSYSMail = Server.CreateObject("CDO.Message")Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "smtp.seudominio.com"objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 30objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusername") = "suaconta@seudominio.com"objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "suasenha"objCDOSYSCon.Fields.updateSet objCDOSYSMail.Configuration = objCDOSYSConobjCDOSYSMail.From = "suaconta@seudominio.com"objCDOSYSMail.To = destinatario'objCDOSYSMail.Bcc = com_copiaobjCDOSYSMail.Subject = assuntoobjCDOSYSMail.HtmlBody = htmlTextobjCDOSYSMail.fields.updateobjCDOSYSMail.SendSet objCDOSYSMail = NothingSet objCDOSYSCon = Nothing%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.