<%
Dim nuevo As Boolean
If Request.Form("fname") = "" And Request.Form("fmail") = "" And Request.Form("fmens") = "" Then
nuevo = True
Else
nuevo = False
End If
Dim valido As Boolean
Dim errores As String
errores = "
Se han producido errores. Por favor, vuelva a intentarlo.
" & vbCrLf
valido = True
If Request.Form("fmail") = "" Then
errores = errores & "
• El correo electrónico es un campo obligatorio.
" & vbCrLf
valido = False
End If
If Request.Form("fmens") = "" Then
errores = errores & "
• No ha introducido nada en el mensaje.
" & vbCrLf
valido = False
End If
If Request.Form("comp") <> "1212" Then
errores = errores & "
• No ha introducido el número de control correctamente. Por favor, pruebe de nuevo.
" & vbCrLf
valido = False
End If
Dim x As Integer
Dim k1 As Integer
Dim k2 As Integer
k1 = 0
k2 = 0
For x = 1 To Len(Request.Form("fmail"))
If Mid(Request.Form("fmail"), x, 1) = "@" Then k1 = x
If Mid(Request.Form("fmail"), x, 1) = "." Then k2 = x
Next
If k1 > k2 Or k1 <= 1 Or k2 < 3 Then
valido = False
errores = errores & "
• Debe introducir un correo electrónico válido.
" & vbCrLf
End If
If valido Then
Dim strA As String
strA = "Nombre: " & Request.Form("fname") & vbCrLf & Request.Form("fmail") & vbCrLf & Request.Form("fmens")
Dim mens As New System.Net.Mail.MailMessage
mens.From = New System.Net.Mail.MailAddress("director@ifie.es")
mens.To.Add("director@ifie.es")
mens.Subject = "Correo web IFIE: " & Request.Form("fname")
mens.Body = strA
mens.IsBodyHtml = False
mens.Priority = System.Net.Mail.MailPriority.Normal
Dim cliente As New System.Net.Mail.SmtpClient
cliente.Host = "localhost"
' cliente.Credentials = New System.Net.NetworkCredential("usuario", "password")
Try
cliente.Send(mens)
If Request.Form("fname") = "" Then
Response.Write("