
18/08/2002, 16:16
|
 | | | Fecha de Ingreso: mayo-2001 Ubicación: Frente al Monitor :þ
Mensajes: 995
Antigüedad: 24 años Puntos: 0 | |
Re: Envio de Formulario ASP <%
str_nom = request.form("nom")
str_mail = Request.Form("mail")
str_to = Request.Form("to")
str_asu = request.form("subject")
str_men = request.form("men") & chr(13)
'comprobamos que haya completado el formulario
if str_nom = "" or str_men = "" or str_to = "" then
%>
<table width="720" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#0066FF">
<form method="post" action="email.asp">
<tr>
<td>Nombre:</td>
<td><input type="text" name="nom" size="80"></div></td>
</tr>
<tr>
<td>Tu email:</td>
<td><input type="text" name="mail" size="80"></td>
</tr>
<tr>
<td>Para <font size="2">[email]</font>:</td>
<td><input type="text" name="to" size="80"></td>
</tr>
<tr>
<td>Asunto:</td>
<td><input type="text" name="subject" size="80"></td> </tr>
<tr>
<td>Mensaje:</td>
<td><textarea name="men" rows="10" cols="80"></textarea></td>
</tr>
</form>
</table>
<%
else
str_men = Replace(str_men, chr(13), "<br>")
str_from = str_nom & "<" & str_mail & ">"
str_body = "<html><body>"
str_body = str_body & "<br>"& str_men &"<p><br>"
str_body = str_body & "</body></html>"
'instanciamos el objeto
set obj_mail = server.createobject("CDONTS.NewMail")
obj_mail.From = str_from
obj_mail.to = str_to
obj_mail.Subject = str_asu
obj_mail.Bodyformat=0
obj_mail.Body = str_body
obj_mail.Send 'envía el mail
set obj_mail = nothing
'mostramos por pantalla
response.write "<p><center><h1><font color=""#FFCCFF"">Email enviado Satisfactoriamente a "& str_to &" :þ ...</font></h1></center>"
end if
%>
algo así... ;)
PD: para las faqs :P
<div align=right><embed src="http://www.jesusdaniel.com/jd.swf" height=25 width=200 wmode="transparent"></embed><br>Usuario # 3359 en los foros</div> |