Hola,
En primer lugar agradecer el tiempo dedicado en leer mi post. Tengo un problema con envio de asp mediante la librería pertsis. En un principio está correctamente (creo) y no funciona. La librería pertsis está instalada correctamente ya que otros formularios envia correctamente.
No da ningún error en el error_log ni en el envio, aparentemente ejecuta correctamente el asp pero no envia el correo.
Es un formulario de rellenar campos y envia un mail al cliente. Adjunto el código.
Agradezco de antemano si me podeis dar algúna idea por donde ir.
Saludos a todos
<%@ Language=VBScript %>
<%Option Explicit%>
'------------------------------------------------
Dim strFolder, bolUpload, strMessage
Dim httpref, lngFileSize
Dim strIncludes, strExcludes
' Create the FileUploader
Dim Uploader, File
Set Uploader = New FileUploader
' This starts the upload process
Uploader.Upload()
'******************************************
' Use [FileUploader object].Form to access
' additional form variables submitted with
' the file upload(s). (used below)
'******************************************
' Check if any files were uploaded
If Uploader.Files.Count = 0 Then
strMessage = "No file entered."
Else
' Loop through the uploaded files
For Each File In Uploader.Files.Items
bolUpload = false
'Response.Write lngMaxSize
'Response.End
if lngFileSize = 0 then
bolUpload = true
else
if File.FileSize > lngFileSize then
bolUpload = false
strMessage = "File too large"
else
bolUpload = true
end if
end if
if bolUpload = true then
'Check to see if file extensions are excluded
If strExcludes <> "" Then
If ValidFileExtension(File.FileName, strExcludes) Then
strMessage = "It is not allowed to upload a file containing a [." & GetFileExtension(File.FileName) & "] extension"
bolUpload = false
End If
End If
'Check to see if file extensions are included
If strIncludes <> "" Then
If InValidFileExtension(File.FileName, strIncludes) Then
strMessage = "It is not allowed to upload a file containing a [." & GetFileExtension(File.FileName) & "] extension"
bolUpload = false
End If
End If
end if
if bolUpload = true then
File.SaveToDisk strFolder ' Save the file
strMessage = "File Uploaded: " & File.FileName
'strMessage = strMessage & "Size: " & File.FileSize & " bytes<br>"
'strMessage = strMessage & "Type: " & File.ContentType & "<br><br>"
end if
Next
'
Dim nombre, apellidos, estudios, dni, ss, fechaNac, pobNac, cp, telfFijo, telfMovil, email, poblacion, cv, foto, altura, disponibilidad, calzado, talla, ingles, aleman, frances, italiano, otrosIdiomas, informatica, carnet, vehiculo, experiencia, conocido
nombre = Uploader.Form("nombre") 'Used to extract fields in the form
apellidos = Uploader.Form("apellidos")
estudios = Uploader.Form("estudios")
dni = Uploader.Form("dni")
ss = Uploader.Form("nss")
fechaNac = Uploader.Form("fechaNac")
pobNac = Uploader.Form("pobNac")
cp = Uploader.Form("cp")
telfFijo = Uploader.Form("telfFijo")
telfMovil = Uploader.Form("telfMovil")
email = Uploader.Form("email")
poblacion = Uploader.Form("poblacion")
cv = Uploader.Form("file22")
foto = Uploader.Form("file11")
altura = Uploader.Form("altura")
disponibilidad = Uploader.Form("disponibilidad")
calzado = Uploader.Form("calzado")
talla = Uploader.Form("talla")
ingles = Uploader.Form("ingles")
aleman = Uploader.Form("aleman")
frances = Uploader.Form("frances")
italiano = Uploader.Form("italiano")
otrosIdiomas = Uploader.Form("otrosIdiomas")
informatica = Uploader.Form("informatica")
carnet = Uploader.Form("carnet")
vehiculo = Uploader.Form("vehiculo")
experiencia = Uploader.Form("experiencia")
conocido = Uploader.Form("conocido")
Dim Cuerpo
Cuerpo = ""
Cuerpo = Cuerpo & "============= Trabaja con Web ======================="& "<br/>"
Cuerpo = Cuerpo & "Nombre y apellidos: "& nombre &" "& apellidos &" "& "<br/>"
Cuerpo = Cuerpo & "Estudios: "& estudios &" "& "<br/>"
Cuerpo = Cuerpo & "DNI: "& dni &" "& "<br/>"
Cuerpo = Cuerpo & "Seguridad social: "& ss &" "& "<br/>"
Cuerpo = Cuerpo & "Fecha de nacimiento: "& fechaNac &" "& "<br/>"
Cuerpo = Cuerpo & "Lugar de nacimiento: "& pobNac &" "& "<br/>"
Cuerpo = Cuerpo & "Población: "& poblacion &" "& "<br/>"
Cuerpo = Cuerpo & "CP: "& cp &" "& "<br/>"
Cuerpo = Cuerpo & "CV: <a href='http://www.domain.com/files/"& cv &"'>"& cv &"</a>"& "<br/>"
Cuerpo = Cuerpo & "Foto: <a href='http://www.domain.com/files/"& foto &"'>"& foto &"</a>"& "<br/>"
Cuerpo = Cuerpo & "Nivel de inglés: "& ingles &" "& "<br/>"
Cuerpo = Cuerpo & "Nivel de alemán: "& aleman &" "& "<br/>"
Cuerpo = Cuerpo & "Nivel de francés: "& frances &" "& "<br/>"
Cuerpo = Cuerpo & "Nivel de italiano: "& italiano &" "& "<br/>"
Cuerpo = Cuerpo & "Otros idiomas: "& otrosIdiomas &" "& "<br/>"
Cuerpo = Cuerpo & "Informatica: "& informatica &" "& "<br/>"
Cuerpo = Cuerpo & "Teléfono 1: "& telfFijo &" "& "<br/>"
Cuerpo = Cuerpo & "Teléfono 2: "& telfMovil &" "& "<br/>"
Cuerpo = Cuerpo & "Email: "& email &" "& "<br/>"
Cuerpo = Cuerpo & "Carnet: "& carnet &" "& "<br/>"
Cuerpo = Cuerpo & "Vehículo: "& vehiculo &" "& "<br/>"
Cuerpo = Cuerpo & "Altura: "& altura &" "& "<br/>"
Cuerpo = Cuerpo & "Calzado: "& calzado &" "& "<br/>"
Cuerpo = Cuerpo & "Talla: "& talla &" "& "<br/>"
Cuerpo = Cuerpo & "Disponibilidad: "& disponibilidad &" "& "<br/>"
Cuerpo = Cuerpo & "Experiencia: "& experiencia &" "& "<br/>"
Cuerpo = Cuerpo & "Como nos has conocido: "& conocido &" "& "<br/>"
SendMail "
[email protected]","Trabaja en Tais","
[email protected]","Contacto de Web Web",Cuerpo,"127.0.0.1"
'Response.write "<html><head><title>OkMail</title></head><body onload='self.close()'></body></html>"
End If
'Response.Redirect ("uploadform.asp?msg=" & strMessage)
'Server.Execute "enviamail2.asp"
Response.Redirect ("gracias.html")
'--------------------------------------------
' ValidFileExtension()
' You give a list of file extensions that are allowed to be uploaded.
' Purpose: Checks if the file extension is allowed
' Inputs: strFileName -- the filename
' strFileExtension -- the fileextensions not allowed
' Returns: boolean
' Gives False if the file extension is NOT allowed
'--------------------------------------------
Function ValidFileExtension(strFileName, strFileExtensions)
Dim arrExtension
Dim strFileExtension
Dim i
strFileExtension = UCase(GetFileExtension(strFileName))
arrExtension = Split(UCase(strFileExtensions), ";")
For i = 0 To UBound(arrExtension)
'Check to see if a "dot" exists
If Left(arrExtension(i), 1) = "." Then
arrExtension(i) = Replace(arrExtension(i), ".", vbNullString)
End If
'Check to see if FileExtension is allowed
If arrExtension(i) = strFileExtension Then
ValidFileExtension = True
Exit Function
End If
Next
ValidFileExtension = False
End Function
'--------------------------------------------
' InValidFileExtension()
' You give a list of file extensions that are not allowed.
' Purpose: Checks if the file extension is not allowed
' Inputs: strFileName -- the filename
' strFileExtension -- the fileextensions that are allowed
' Returns: boolean
' Gives False if the file extension is NOT allowed
'--------------------------------------------
Function InValidFileExtension(strFileName, strFileExtensions)
Dim arrExtension
Dim strFileExtension
Dim i
strFileExtension = UCase(GetFileExtension(strFileName))
'Response.Write "filename : " & strFileName & "<br>"
'Response.Write "file extension : " & strFileExtension & "<br>"
'Response.Write strFileExtensions & "<br>"
'Response.End
arrExtension = Split(UCase(strFileExtensions), ";")
For i = 0 To UBound(arrExtension)
'Check to see if a "dot" exists
If Left(arrExtension(i), 1) = "." Then
arrExtension(i) = Replace(arrExtension(i), ".", vbNullString)
End If
'Check to see if FileExtension is not allowed
If arrExtension(i) = strFileExtension Then
InValidFileExtension = False
Exit Function
End If
Next
InValidFileExtension = True
End Function
'--------------------------------------------
' GetFileExtension()
' Purpose: Returns the extension of a filename
' Inputs: strFileName -- string containing the filename
' varContent -- variant containing the filedata
' Outputs: a string containing the fileextension
'--------------------------------------------
Function GetFileExtension(strFileName)
GetFileExtension = Mid(strFileName, InStrRev(strFileName, ".") + 1)
End Function
Sub SendMail(strFrom, strFromName, strTo, strSubject, strBody,strHost)
Dim Mail
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = strHost
Mail.Username = "
[email protected]"
Mail.Password = "AzTa10"
Mail.From = strFrom
Mail.FromName = strFromName
Mail.AddAddress strTo
Mail.Subject = strSubject
Mail.Body = strBody
' Mail.AddAttachment cvAt
' Mail.AddAttachment fotoAt
Mail.isHTML = True
' Mail.Port = 25
' Mail.ContentTransferEncoding = "Quoted-Printable"
On Error Resume Next
Mail.Send
If Err <> 0 Then
Response.Write "Se ha producido un error " & Err.Description
End if
End Sub
%>