|
|
Servicios Recambios
<%
if not Request.ServerVariables("REQUEST_METHOD") = "POST" then
'no recibo formulario, entonces lo muestro
%>
Si desea que le enviemos un recambio para
su equipo rellene el siguiente formulario. Los campos marcados
con un asterisco (*)
son obligatorios. Y recuerde que si no indica el código
del recambio se le cobrarán 3 € en concepto de codificación
independiente de las unidades solicitadas. Gastos de envío: ver
tarifas.
NOTA: Los campos marcados con asterisco
(*) son obligatorios.
<%Else
'recojo los datos
Dim sMarca, sModelo, sNumserie, sCodigo,sUnidades, sDescripcion, sNombre, sApellidos
Dim sDireccion, sPoblacion, sProvincia, sCodPostal, sEmail, sTelefono, sFax
Dim sSistemaEntrega, sTipoEntrega, sSistemaPago, sNoInfoComercial, cuerpo, bEnviar
bEnviar = true
Set Upload = Server.CreateObject("Persits.Upload")
' we use memory uploads, so we must limit file size
Upload.SetMaxSize 100000, True
' capture an upload and save uploaded files (if any) in temp directory
On Error Resume Next
Upload.Save
' 8 is the number of "File too large" exception
If Err.Number = 8 Then
%>
El archivo es demasiado
grande.
Recuerde que el tamaño máximo permitido es de 100 kB.
Por favor inténtelo de nuevo. |
<%
Else
If Err <> 0 Then
%>
Error, no se ha
podido completar la operación. |
<%
Else
sMarca = Upload.form("Marca")
sModelo = Upload.form("Modelo")
sNumserie = Upload.form("Numserie")
sCodigo = Upload.form("Codigo")
sUnidades = Upload.form("Unidades")
sDescripcion = Upload.form("Descripcion")
sNombre = Upload.form("Nombre")
sApellidos = Upload.form("Apellidos")
sDireccion = Upload.form("Direccion")
sPoblacion = Upload.form("Poblacion")
sProvincia = Upload.form("Provincia")
sCodPostal = Upload.form("CodPostal")
sEmail = Upload.form("Email")
sTelefono = Upload.form("Telefono")
sFax = Upload.form("Fax")
sSistemaEntrega = Upload.form("SistemaEntrega")
sTipoEntrega = Upload.form("TipoEntrega")
sSistemaPago = Upload.form("SistemaPago")
if sSistemaPago = "Otro" then
sSistemaPago = sSistemaPago & " - " & Upload.Form("txtOtro")
end if
sNoInfoComercial = Upload.form("NoInfoComercial")
'compongo el cuerpo del mensaje
cuerpo = "DATOS DEL RECAMBIO" & VBNEWLINE & VBNEWLINE
cuerpo = cuerpo & "Marca: " & sMarca & VBNEWLINE
cuerpo = cuerpo & "Modelo: " & sModelo & VBNEWLINE
'if not sNumSerie = "" then
cuerpo = cuerpo & "Número de serie: " & sNumSerie & VBNEWLINE
'end if
'if not sCodigo = "" then
cuerpo = cuerpo & "Código de recambio: " & sCodigo & VBNEWLINE
'end if
'if not sDescripcion = "" then
cuerpo = cuerpo & "Número de unidades: " & sUnidades & VBNEWLINE
'end if
'if not sDescripcion = "" then
cuerpo = cuerpo & "Descripción de recambio: " & sDescripcion & VBNEWLINE
'end if
cuerpo = cuerpo & VBNEWLINE
cuerpo = cuerpo & "DATOS DEL CLIENTE " & VBNEWLINE & VBNEWLINE
cuerpo = cuerpo & "Nombre: " & sNombre & VBNEWLINE
cuerpo = cuerpo & "Apellidos: " & sApellidos & VBNEWLINE
cuerpo = cuerpo & "Dirección: " & sDireccion & VBNEWLINE
cuerpo = cuerpo & "Población: " & sPoblacion & VBNEWLINE
cuerpo = cuerpo & "Provincia: " & sProvincia & VBNEWLINE
cuerpo = cuerpo & "Código Postal: " & sCodPostal & VBNEWLINE
'if not sEmail = "" then
cuerpo = cuerpo & "Correo Electrónico: " & sEmail & VBNEWLINE
'end if
cuerpo = cuerpo & "Teléfono: " & sTelefono & VBNEWLINE
'if not sFax = "" then
cuerpo = cuerpo & "Fax: " & sFax & VBNEWLINE
'end if
cuerpo = cuerpo & VBNEWLINE
cuerpo = cuerpo & "DATOS DE LA ENTREGA" & VBNEWLINE & VBNEWLINE
cuerpo = cuerpo & "Sistema de Entrega: " & sSistemaEntrega & VBNEWLINE
'if not sTipoEntrega = "" then
cuerpo = cuerpo & "Tipo de Entrega: " & sTipoEntrega & VBNEWLINE
'end if
'if not sSistemaPago = "" then
cuerpo = cuerpo & "Sistema de Pago: " & sSistemaPago & VBNEWLINE
'end if
cuerpo = cuerpo & VBNEWLINE
'if not sNoInfoComercial = "" then
cuerpo = cuerpo & "Protección de datos: " & sNoInfoComercial & VBNEWLINE
'end if
cuerpo = cuerpo & VBNEWLINE
'creo un cuerpo2 para el mensaje de la tranquilidad que se envia automaticamente
cuerpo2 = "Su solicitud está en curso, en breve recibirá la valoración de su pedido y el sistema de pago." & VBNEWLINE & "Gracias por contactar con nosotros." & VBNEWLINE & VBNEWLINE & VBNEWLINE
cuerpo2 = cuerpo2 & "DATOS DEL RECAMBIO" & VBNEWLINE & VBNEWLINE
cuerpo2 = cuerpo2 & "Marca: " & sMarca & VBNEWLINE
cuerpo2 = cuerpo2 & "Modelo: " & sModelo & VBNEWLINE
'if not sNumSerie = "" then
cuerpo2 = cuerpo2 & "Número de serie: " & sNumSerie & VBNEWLINE
'end if
'if not sCodigo = "" then
cuerpo2 = cuerpo2 & "Código de recambio: " & sCodigo & VBNEWLINE
'end if
'if not sDescripcion = "" then
cuerpo2 = cuerpo2 & "Número de unidades: " & sUnidades & VBNEWLINE
'end if
'if not sDescripcion = "" then
cuerpo2 = cuerpo2 & "Descripción de recambio: " & sDescripcion & VBNEWLINE
'end if
cuerpo2 = cuerpo2 & VBNEWLINE
cuerpo2 = cuerpo2 & "DATOS DEL CLIENTE " & VBNEWLINE & VBNEWLINE
cuerpo2 = cuerpo2 & "Nombre: " & sNombre & VBNEWLINE
cuerpo2 = cuerpo2 & "Apellidos: " & sApellidos & VBNEWLINE
cuerpo2 = cuerpo2 & "Dirección: " & sDireccion & VBNEWLINE
cuerpo2 = cuerpo2 & "Población: " & sPoblacion & VBNEWLINE
cuerpo2 = cuerpo2 & "Provincia: " & sProvincia & VBNEWLINE
cuerpo2 = cuerpo2 & "Código Postal: " & sCodPostal & VBNEWLINE
'if not sEmail = "" then
cuerpo2 = cuerpo2 & "Correo Electrónico: " & sEmail & VBNEWLINE
'end if
cuerpo2 = cuerpo2 & "Teléfono: " & sTelefono & VBNEWLINE
'if not sFax = "" then
cuerpo2 = cuerpo2 & "Fax: " & sFax & VBNEWLINE
'end if
cuerpo2 = cuerpo2 & VBNEWLINE
cuerpo2 = cuerpo2 & "DATOS DE LA ENTREGA" & VBNEWLINE & VBNEWLINE
cuerpo2 = cuerpo2 & "Sistema de Entrega: " & sSistemaEntrega & VBNEWLINE
'if not sTipoEntrega = "" then
cuerpo = cuerpo & "Tipo de Entrega: " & sTipoEntrega & VBNEWLINE
'end if
if not sSistemaPago = "" then
cuerpo2 = cuerpo2 & "Sistema de Pago: " & sSistemaPago & VBNEWLINE
end if
cuerpo2 = cuerpo2 & VBNEWLINE
'mando el correo
'creo el objeto correo
set mail = server.createObject("Persits.MailSender")
'configuro el mensaje
'señalo el servidor de salida para enviar el correo
mail.host = Application("Mail_Host")
mail.username = Application("Mail_User_Name_Recambios")
mail.password = Application("Mail_Password_Recambios")
'indico la dirección de correo del remitente
mail.from = Application("Mail_From_Recambios")
'indico la dirección del destinatario del mensaje
mail.addAddress Application("Mail_Address_Recambios")
'indico el asunto del mensaje
mail.Subject = "Pedido: " & sApellidos
' Handle attached file via Upload.Files collection.
' Check if a file was ineed uploaded
Set archivo = Upload.Files("Attachment")
If Not archivo Is Nothing Then
if archivo.imagetype = "UNKNOWN" then
bEnviar = false
%>
El archivo no
es un archivo de imagen válido, compruebe que sea
BMP, GIF, JPEG, PNG o TIFF e inténtelo de nuevo. |
<%
else
Mail.AddAttachmentMem archivo.filename, archivo.Binary
end if ' archivo.imagetype
End If ' archivo is nothing
'indico el cuerpo del mensaje
mail.body = cuerpo
if bEnviar then
'lo envio
'aseguro que no se presenten errores en la página si se producen
On Error Resume Next
mail.send
if Err <> 0 then
%>
Error, no se ha
podido completar la operación. |
<%
else
%>
Gracias por rellenar
el formulario. Se ha enviado correctamente y su solicitud
se está procesando. |
<%
'envio el mail de la tranquilidad
set mail2 = server.createObject("Persits.MailSender")
'configuro el mensaje
'señalo el servidor de salida para enviar el correo
mail2.host = Application("Mail_Host")
mail2.username = Application("Mail_User_Name_Recambios")
mail2.password = Application("Mail_Password_Recambios")
'indico la dirección de correo del remitente
mail2.from = Application("Mail_From_Recambios")
'indico la dirección del destinatario del mensaje
mail2.addAddress sEmail
'indico el asunto del mensaje
mail2.Subject = "Petición de recambio SETEM para " & sNombre & " " & sApellidos
mail2.body = cuerpo2
mail2.send
end if ' err <> 0
end if 'bEnviar
set mail = nothing
End If ' err <> 0
End If 'error.number
Set Upload = nothing
end if
%>
|
|