
26/08/2008, 15:33
|
| | Fecha de Ingreso: agosto-2008
Mensajes: 1
Antigüedad: 16 años, 8 meses Puntos: 0 | |
Respuesta: Campos obligatorios... hola tengo un problema similar en un formulario que la empresa del hosting me facilito pues es la unica manera que funciona el envio de mail, pero necesito hacer que los campos sean obligatorios me podrian ayudar? el codigo es el siguiente:
<%
' Envio de correo usando ASPEmail en formato Texto.
Dim message
br = vbCrLf 'Salto de Linea
If Request("Send") <> "" Then
Set Mail = Server.CreateObject("Persits.MailSender")
'Enter valid SMTP host ==> smtp.triara.com, No mover IP
Mail.Host = "200.57.129.3"
'Authentification
Mail.Username = "pruebas@amatech_pruebas.com"
Mail.Password = "pruebas"
Mail.From = "pruebas@amatech_pruebas.com"
Mail.FromName = "Formulario"
' enviar a destinatario
Mail.AddAddress "pruebas@amatech_pruebas.com"
' message subject
Mail.Subject = "Envio de correo desde el Web"
'message body
'Creamos la variable message con todos los datos
message = ""
message = message + " " + FormatDateTime(Date) + br + br
message = message + "Nombre = " + Request("nombre") + br
message = message + "Empresa = " + Request("empresa") + br
message = message + "Teléfono = " + Request("tel") + br
message = message + "Fax = " + Request("fax") + br
message = message + "Email = " + Request("email") + br
message = message + "Comentarios = " + Request("comentarios") + br
message = message + "Formulario."
Mail.Body = message
On Error Resume Next
Mail.Send
If Err <> 0 Then
Response.Write "Error encontrado: " & Err.Description
Else
Response.buffer=true
Response.redirect "body.htm"
End If
End If
%>
<body>
<form ACTION="EnviaASPMail.asp">
<table border="0" width="50%">
</p>
</td>
</tr>
<tr align="center">
<td width="456" bgcolor="#FBDCCF">
<p> </p>
<table BORDER=0 CELLSPACING=0 CELLPADDING=2 bgcolor="#FFFFFF" style="border-collapse: collapse" bordercolor="#111111" ><tr>
<td width="50%"><font face="Arial" color="#000019"> Nombre :</font></td>
<td width="50%"><input TYPE="TEXT" NAME="nombre" size="40"></td>
</tr>
<tr>
<td width="50%"><font face="Arial" color="#000019"> Empresa :</font></td>
<td width="50%"><input TYPE="TEXT" NAME="empresa" size="40"></td>
</tr>
<tr>
<td width="50%"><font face="Arial" color="#000019">Telefono:</font></td>
<td width="50%"><input TYPE="TEXT" NAME="tel" size="20"></td>
</tr>
<tr>
<td width="50%"><font face="Arial" color="#000019"> Fax :</font></td>
<td width="50%"><input TYPE="TEXT" NAME="fax" size="20"></td>
</tr>
<tr>
<td width="50%"><font face="Arial" color="#000019"> Email :</font></td>
<td width="50%"><input TYPE="TEXT" NAME="email" size="40"></td>
</tr>
<tr>
<td width="50%"><font face="Arial" color="#000019"> Comentarios :</font></td>
<td width="50%"><input TYPE="TEXT" NAME="comentarios" size="40"></td>
</tr>
<tr>
<td width="50%"></td>
<td width="50%"><br>
<input TYPE="SUBMIT" NAME="Send" VALUE="Send"></td>
</tr>
</table>
</form>
</body>
</html> |