JPRC Posted February 18, 2009 at 09:23 PM Report Share #245428 Posted February 18, 2009 at 09:23 PM Baseado em algum código na net e outro, alguêm podera dizer porque não está a funcionar? formasp.asp <html><head> <title>Associação de Pais</title> </head> <body topmargin="0" leftmargin="0"> <div align="center"> <font size="3"> <center> <table border="0" width="266"> <tr> <td width="358" valign="top" height="2"> <form method="POST" action="enviaemail.asp"> <div align="center"> <p><font size="3"> <center> </p> <br> <br> <br> <p><font color="#000000" size="3" face="Verdana, Arial, Helvetica, sans-serif"> <font size="4"><strong><u>Associação de Pais</u></strong></font></font> </p> <table border="0" width="50%" cellspacing="0" cellpadding="0"> <td width="0%"> </td> <tr> <td width="4%"></td> <td width="96%"> <p align="left"><font size="3" face="Verdana">Nome Completo:</font></td> </tr> <tr> <td width="4%"></td> <td width="96%"> <p align="left"><font size="3" face="Verdana"> <input type="text" name="nomecompleto" size="50" style="font-family: Verdana; border-style: solid; border-width: 1"> </font></td> </tr> <tr> <td width="4%"></td> <td width="96%"> <br> <p align="left"><font size="3" face="Verdana">Morada:</font></td> </tr> <tr> <td width="4%"></td> <td width="96%"> <p align="left"><font size="3" face="Verdana"> <input type="text" name="morada" size="50" style="font-family: Verdana; border-style: solid; border-width: 1"> </font></td> </tr> <tr> <td width="4%"></td> <td width="96%"> <br> <p align="left"><font size="3" face="Verdana">Telefone:</font></td> </tr> <tr> <td width="4%"></td> <td width="96%"> <p align="left"><font size="3" face="Verdana"> <input type="text" name="telefone" size="9" style="font-family: Verdana; border-style: solid; border-width: 1"> </font></td> </tr> <tr> <tr> <td width="4%"></td> <td width="96%"> <br> <p align="left"><font size="3" face="Verdana">E-mail:</font></td> </tr> <tr> <td width="4%"></td> <td width="96%"> <p align="left"><font size="3" face="Verdana"> <input type="text" name="email" size="50" style="font-family: Verdana; border-style: solid; border-width: 1"> </font></td> </tr> <tr> <td width="4%"></td> <td width="96%"> <p align="left"> <br> <p align="left"><font size="3" face="Verdana">Observações:</font></td> </tr> <tr> <td width="4%"></td> <td width="96%"> <p align="left"><font size="3" face="Verdana"> <textarea rows="7" name="obs" cols="50" style="font-family: Verdana; border-style: solid; border-width: 1"></textarea> </font></td> </tr> <tr> <td width="96%"></td> </tr> <tr> <p> <td width="4%"></td> <td width="96%"> <p align="center"><font size="1" face="Verdana"> </font></td> </tr> </table> <input type="submit" value="Enviar"> </div> </body> </html> enviaremail.asp <% Set Mailer = Server.CreateObject("SMTPsvg.Mailer") Mailer.FromName = request("nome") Mailer.FromAddress = request("email") Mailer.RemoteHost = "mail.mun-aljustrel.pt" Mailer.AddRecipient "Formulário" , "JorgeConduto@hotmail.com" Mailer.Subject = "Formulário" Mailer.BodyText = "Nome..........: " & request.form("nome") & vbcrlf Mailer.BodyText = "Morada.........: " & request.form("morada") & vbcrlf Mailer.BodyText = "Telefone.........: " & request.form("telefone") & vbcrlf Mailer.BodyText = "E-Mail.........: " & request.form("email") & vbcrlf Mailer.BodyText = "Observações.........: " & request.form("obsa") & vbcrlf if Mailer.SendMail then Response.redirect "mun-aljustrel.pt" else Response.Write mailer.response end if %> ? Link to comment Share on other sites More sharing options...
Hellblazer Posted February 19, 2009 at 09:03 AM Report Share #245484 Posted February 19, 2009 at 09:03 AM E continua no sitio errado 😛 Isto não é ASP.NET 😄 é ASP normal 🙂 No entanto verifica se os valores que vais buscar com o Request.Form não estão a vir nulos 🙂 ou se o SMTP está correcto. EDIT: Estive a ver agora e o SMTP da Sapo precisa de Autenticação com username e password... There are two ways to write error-free programs; only the third one works. Link to comment Share on other sites More sharing options...
JPRC Posted February 19, 2009 at 09:42 AM Author Report Share #245493 Posted February 19, 2009 at 09:42 AM Pois estou a ver que sim, eu só meti ali um mail e um dominio como exemplo. Mas eu esta tarde vou testar mesmo no host, pois isto vai ligar a um site. Porque testei apenas pelo ISS. Aquilo apenas é para ligar a um site no qual o user preenche e envia para o e-mail, e o alojamento só aceita asp. Pois em php, seria bastante fácil. Link to comment Share on other sites More sharing options...
Hellblazer Posted February 19, 2009 at 10:06 AM Report Share #245499 Posted February 19, 2009 at 10:06 AM Entao pede a um moderador para mover este topico para a parte de ASP 😄 porque esta secção e de ASP.NET 🙂 PS: Nao sei como é em ASP mas no ASP.NET precisas que os controlos estejam runat server para acederes a eles no codigo 🙂 logo os Request.Form que estas a fazer devem retornar null 😛 There are two ways to write error-free programs; only the third one works. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now