Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/04/2010, 12:01
miralcel
 
Fecha de Ingreso: marzo-2006
Mensajes: 5
Antigüedad: 18 años, 11 meses
Puntos: 1
Problemas con Formulario flash

Hola, llevo semanas peleándome con el formulario y no hay manera de que se envíe. Ya he comprobado que el servidor funciona en php y admite smtp. En principio no me da ningún error, pero el formulario nunca llega a enviarse. ¿Qué puede ser?? ayudaaa!!!

Código PHP:
Ver original
  1. <?php
  2. //-----------------Getting data sent by flash---------------------
  3. foreach ($_POST as $key => $value){
  4.  
  5.         if ($key != 'mail_to' && $key != 'smtp_server' && $key != 'smtp_port' && $key != 'mail_from' && $key != 'mail_subject' && $key != 'plain_text'){
  6.    
  7.             $mail_body .= '<b>'.str_replace('_',' ',$key).'</b>:<br/>';
  8.    
  9.             $mail_body .= ''.stripslashes($value).'<br/>';
  10.         }
  11. }
  12. //-----------------------------------------------------------------
  13.  
  14.  
  15.  
  16. $message = '<html><body>'.$mail_body.'</body></html>'; //  mail body
  17.  
  18. //------------if plain text is set to true removing html tags------
  19. if ($_POST['plain_text']=='true') {
  20.  
  21.     $message = str_replace('<br/>',"\r\n", $message);
  22.  
  23.     $message = strip_tags($message);
  24.  
  25. //------------------------------------------------------------------
  26. } else {
  27. //----otherwise composing message headers---------------------------
  28.     $headers  = 'MIME-Version: 1.0' . "\r\n";
  29.    
  30.     $headers .= 'Content-type: text/html; charset=windows-1251' . "\r\n";
  31. //------------------------------------------------------------------
  32. }
  33.  
  34. //------------setting conf data-------------------------------------
  35. $to = $_POST['mail_to'];
  36.  
  37. $from = $_POST['mail_from'];
  38.  
  39. $subject = $_POST['mail_subject'];
  40.  
  41. $smtp_server = $_POST['smtp_server'];
  42.  
  43. $smtp_port = $_POST['smtp_port'];
  44. //------------------------------------------------------------------
  45.  
  46. //---------setting header info--------------------------------------
  47.  
  48.  
  49. $headers .= 'From:' .$from;
  50. //------------------------------------------------------------------
  51.  
  52.  
  53. if (mail($to, $subject, $message, $headers)){ // sending mail
  54.  
  55.     print('&mail=1');  //succes
  56.  
  57. } else {
  58.  
  59.     print('&mail=0');//failure
  60.  
  61. }
  62.  
  63. ?>
Código XML:
Ver original
  1. <?xml version="1.0" encoding="utf-8"?>
  2.  
  3. <contactFormConfiguration>
  4.  
  5.     <emailTo>[email protected]</emailTo>
  6.    
  7.     <serverProcessorType>php</serverProcessorType>
  8.    
  9.     <serverProcessorFileName>contact</serverProcessorFileName>
  10.    
  11.     <validateRequiredOnly>false</validateRequiredOnly>
  12.    
  13.     <submitFormOnEnter>false</submitFormOnEnter>
  14.    
  15.     <messageSentText>Gracias por su mensaje.</messageSentText>
  16.    
  17.     <messageSentFailedText>Lo sentimos, su mensaje no puedo enviarse.</messageSentFailedText>
  18.    
  19.     <formProcessingText>enviando...</formProcessingText>
  20.    
  21.     <smtpServer>localhost</smtpServer>
  22.    
  23.     <smtpPort>25</smtpPort>
  24.    
  25.     <plainText>false</plainText>
  26.    
  27.     <emailFromSource>3</emailFromSource>
  28.    
  29.     <subjectSource>Contact Form from your site</subjectSource>
  30.    
  31.     <validationErrorMessages>  
  32.        
  33.         <message type="fieldIsRequired">{LABEL} is required.</message>
  34.        
  35.         <message type="emailNotValid">{LABEL} - is not valid email address.</message>
  36.        
  37.         <message type="minCharsLimitError">{LABEL} - The specified number of characters in a field is less than a required minimum.</message>
  38.        
  39.         <message type="reqExpError">{LABEL} - The specified string does not match with the regular expression.</message>
  40.        
  41.         <message type="biggerThanMaxError">{LABEL} - The specified number is greater than an acceptable biggest number for this field.</message>
  42.        
  43.         <message type="lowerThanMinError">{LABEL} - The specified number is lower than an acceptable lowest number for this field.</message>
  44.        
  45.         <message type="notANumberError">{LABEL} - The data is not a number.</message>
  46.        
  47.         <message type="negativeError">{LABEL} - The specified number must not be negative.</message>
  48.        
  49.         <message type="minRequirementError">{LABEL} - The minimum number of variants is not selected</message>
  50.        
  51.         <message type="maxRequirementError">{LABEL} - The number of variants selected exceeds the maximum</message>
  52.        
  53.         <message type="shouldBeEqualError">{LABEL} - values do not match</message>
  54.  
  55.         <message type="dateIsNotValidError">{LABEL} - date has wrong format</message>
  56.  
  57.     </validationErrorMessages>
  58.    
  59. </contactFormConfiguration>
Código XML:
Ver original
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <contactFormStructure>
  3.    
  4.     <formItems>
  5.  
  6.         <item id="1" label="Name" required="true">
  7.             <textToShow>Nombre*:</textToShow>
  8.         </item>
  9.  
  10.         <item id="2" label="Phone">
  11.             <textToShow>Teléfono:</textToShow>                    
  12.                         <restrict>+-.0-9</restrict>
  13.         </item>
  14.  
  15.         <item id="3" label="E-mail" required="true">
  16.             <textToShow>E-mail*:</textToShow>
  17.             <validator>EmailValidator</validator>
  18.         </item>
  19.  
  20.         <item id="4" label="Message" required="true">
  21.             <textToShow>Mensaje*:</textToShow>
  22.         </item>
  23.  
  24.     </formItems>
  25.    
  26. </contactFormStructure>