Foros del Web » Programando para Internet » ASP Clásico »

Form Mail script

Estas en el tema de Form Mail script en el foro de ASP Clásico en Foros del Web. Hola querría que me ayudaran. He comprado varias plantillas de www.template-help.com , tengo algunos hosting en PHP y siempre me ha funcionado. La plantilla es ...
  #1 (permalink)  
Antiguo 30/01/2011, 17:19
 
Fecha de Ingreso: mayo-2009
Mensajes: 6
Antigüedad: 15 años
Puntos: 0
Form Mail script

Hola querría que me ayudaran. He comprado varias plantillas de www.template-help.com, tengo algunos hosting en PHP y siempre me ha funcionado. La plantilla es en flash y XML.
Pero ahora he tenido que utilizar un hosting en ASP y no me funciona. Desde 1&1 no me han dicho nada y no se que pensar. Pero he seguido todo lo que pone en el arxivo de configuración del XML.

Les agradeceria que me ayudaran. Muchisimas gracias.

Os adjunto el código del archivo form04structure.xml

Código XML:
Ver original
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!--
  3.         Please read this information to learn how to set up the contact form integrated
  4.         into the template.
  5.        
  6.         This readme file explains in details the meaning of the settings that can be
  7.         done in the fcContactFormConfiguration.xml configuration file.
  8.        
  9.         It is recommended for you to use an XML editor to make changes to this file
  10.         because it’s less possible to make an error in the markup which can cause to
  11.         a not working contact form.
  12.  -->
  13. <contactFormConfiguration>
  14.            
  15.     <!--
  16.             An e-mail address which will be used to receive messages from your contact form.
  17.             You can specify several e-mail addresses separating them with a comma.
  18.       -->
  19.     <emailTo>[email protected]</emailTo>
  20.    
  21.     <!--
  22.             A server script type which will process sending e-mails. It depends on your
  23.             hosting and in the current version of the contact form it is allowed to use
  24.             two types:  php (Apache, PHP Hosting); asp (IIS web server, ASP).
  25.       -->
  26.     <serverProcessorType>asp</serverProcessorType>
  27.    
  28.     <!--
  29.             A name of the script file which process sending e-mails on your server (without
  30.             extension). The name contact is used by default.
  31.       -->
  32.     <serverProcessorFileName>contact</serverProcessorFileName>
  33.    
  34.     <!--
  35.             Set whether to validate only required fields (true/false).  The default value is
  36.             true which means the not required fields of your contact form will not be validated.
  37.             For example if the e-mail field of your form is set as not required (imagine it)
  38.             the form will be processed even if the user types in an incorrect e-mail address.
  39.       -->
  40.     <validateRequiredOnly>true</validateRequiredOnly>
  41.    
  42.     <!--
  43.             Set whether to submit the form when the Enter key is pressed even if the focus is
  44.             not on the Submit button (true/false).
  45.       -->
  46.     <submitFormOnEnter>false</submitFormOnEnter>
  47.    
  48.     <!--
  49.             Text showing to the user when the form is submitted without any errors.
  50.       -->
  51.     <messageSentText>Gracias por su consulta.</messageSentText>
  52.    
  53.     <!--
  54.             Text showing in case the form is not submitted because of a server error.
  55.       -->
  56.     <messageSentFailedText>Lo sentimos, su mensaje no puede enviarse.</messageSentFailedText>
  57.    
  58.     <!--
  59.             Text your visitor will see while waiting till the processing is over.
  60.       -->
  61.     <formProcessingText>procesando ...</formProcessingText>
  62.    
  63.     <!--
  64.             Your SMTP server (for ASP only).
  65.       -->
  66.     <smtpServer>smtp.1and1.es</smtpServer>
  67.    
  68.     <!--
  69.             Your SMTP port (for ASP only).
  70.       -->
  71.     <smtpPort>25</smtpPort>
  72.    
  73.     <!--
  74.             Set whether to send the message as a plain text (true) or as HTML (false).
  75.       -->
  76.     <plainText>false</plainText>
  77.    
  78.     <!--
  79.             ID of the input field (in the structure XML file) to use for the “from: ”
  80.             or email to use instead (for example: [email protected]).
  81.       -->
  82.     <emailFromSource>3</emailFromSource>
  83.    
  84.     <!--
  85.             Subject of the e-mails that will be sent through this contact form or ID of
  86.             the input field (in the structure XML file) to use for the “subject: ” label
  87.             in your e-mail client.
  88.       -->
  89.     <subjectSource>Formulario Web</subjectSource>
  90.    
  91.     <!--
  92.             Validation error messages that are showing to the user when the form fails to
  93.             validate. The form supports different types of validators. You can change the
  94.             text of the error messages the validators produce here.
  95.        
  96.             You can use the {LABEL} keyword in these messages. It will replace it with the
  97.             label value of the field where an error occurs.
  98.       -->
  99.     <validationErrorMessages>
  100.            
  101.         <!--
  102.                 A required field is not filled in.
  103.           -->
  104.         <message type="fieldIsRequired">{LABEL} es necesario.</message>
  105.        
  106.         <!--   
  107.                 The specified e-mail address is incorrect.
  108.           -->
  109.         <message type="emailNotValid">{LABEL} - no es una dirección de correo válida.</message>
  110.        
  111.         <!--
  112.                 The specified number of characters in a field is less than a required minimum.
  113.           -->
  114.         <message type="minCharsLimitError">{LABEL} - The specified number of characters in a field is less than a required minimum.</message>
  115.        
  116.         <!--
  117.                 The specified string does not match with the regular expression.
  118.           -->
  119.         <message type="reqExpError">{LABEL} - The specified string does not match with the regular expression.</message>
  120.        
  121.         <!--
  122.                 The specified number is greater than an acceptable biggest number for this field.
  123.           -->
  124.         <message type="biggerThanMaxError">{LABEL} - The specified number is greater than an acceptable biggest number for this field.</message>
  125.        
  126.         <!--
  127.                 The specified number is lower than an acceptable lowest number for this field.
  128.           -->
  129.         <message type="lowerThanMinError">{LABEL} - The specified number is lower than an acceptable lowest number for this field.</message>
  130.        
  131.         <!--
  132.                 The data is not a number.
  133.           -->
  134.         <message type="notANumberError">{LABEL} - The data is not a number.</message>
  135.        
  136.         <!--
  137.                 The specified number must not be negative.
  138.           -->
  139.         <message type="negativeError">{LABEL} - The specified number must not be negative.</message>
  140.        
  141.         <!--
  142.                 The minimum number of variants is not selected
  143.           -->
  144.         <message type="minRequirementError">{LABEL} - The minimum number of variants is not selected</message>
  145.        
  146.         <!--
  147.                 The number of variants selected exceeds the maximum
  148.           -->
  149.         <message type="maxRequirementError">{LABEL} - The number of variants selected exceeds the maximum</message>
  150.        
  151.         <!--
  152.                 The fields that should be equal do not match
  153.           -->
  154.         <message type="shouldBeEqualError">{LABEL} - values do not match</message>
  155.  
  156.         <!--
  157.                 The date has wrong format.
  158.           -->
  159.         <message type="dateIsNotValidError">{LABEL} - date has wrong format</message>
  160.  
  161.     </validationErrorMessages>
  162.    
  163. </contactFormConfiguration>

Les adjunto el codigo ASP.

Código ASP:
Ver original
  1. <&#37;
  2. '----function that removes html tags-----------
  3.    Function RemoveHTML( strText )
  4.         Dim RegEx
  5.         Set RegEx = New RegExp
  6.         RegEx.Pattern = "<[^>]*>"
  7.         RegEx.Global = True
  8.         RemoveHTML = RegEx.Replace(strText, "")
  9.     End Function
  10. '---------------------------------------------
  11.    
  12. '------defining script vars-------------------
  13.    Dim mailObj, mailCfg, myBody, fld
  14.  
  15.     Dim RegEx
  16.     set RegEx = New RegExp
  17. '--------------------------------------------
  18.  
  19. '------getting data sent by flash (filtering configuration data)------------
  20.    For Each fld in Request.Form
  21.       If Request.Form(fld) <> "" and _
  22.       fld <> "mail_to" and _
  23.       fld <> "smtp_server" and _
  24.       fld <> "smtp_port" and _
  25.       fld <> "plain_text" and _
  26.       fld <> "mail_from" and _
  27.       fld <> "mail_subject" Then
  28.          myBody = myBody & vbCRLF & "   <b>" & fld & "</b> :<br/> " & Trim(Request.Form(fld)) & "<br/>"
  29.       End If
  30.    Next
  31. '---------------------------------------------------------------------------
  32.  
  33. '----------setting conf data------------------------------------------------
  34.     On Error Resume Next
  35.         Set myMail = CreateObject("CDO.Message")
  36.         myMail.Subject = Request.Form("mail_subject")
  37.         myMail.From =Request.Form("mail_from")
  38.         myMail.To = Request.Form("mail_to")
  39.        
  40. '--------if plain text is set to true removing html---------------------------------------     
  41.         if Request.Form("plain_text") = "true" then
  42.            
  43.             myMail.TextBody = RemoveHTML(myBody)
  44.  
  45. '-------otherwise composing message body--------------------------------------------------         
  46.             else myMail.HTMLBody = "<html><body>" & myBody & "</body></html>"
  47.            
  48.         end if
  49. '----------setting configuration params for smtp----------------------------------------------------------------------------------
  50.         myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 1
  51.         myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = Request.Form("smtp_server")
  52.         myMail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = Request.Form("smtp_port")
  53.         myMail.Configuration.Fields.Update
  54. '---------------------------------------------------------------------------------------------------------------------------------     
  55.         myMail.Send '---------------sending message
  56.  
  57.    If Err = 0 Then
  58.    Response.Write("&mail=1") 'if there the message is sent return 1 to flash
  59.    Else
  60.    Response.Write("&mail=0") 'otherwise return 0
  61.    End If
  62.    
  63. %>

Última edición por noipalaus; 31/01/2011 a las 16:19

Etiquetas: mail, formulario
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 20:55.