Ver Mensaje Individual
  #17 (permalink)  
Antiguo 02/06/2008, 06:42
Avatar de jaronu
jaronu
 
Fecha de Ingreso: febrero-2008
Mensajes: 2.183
Antigüedad: 16 años, 2 meses
Puntos: 52
Respuesta: Formulario que no se envía

Hola. a si lo tengo hecho, y funciona bien:


Código PHP:

<?

if (isset($_POST["email"])) {

    
    
$asunto $_POST ['asunto'];
    
$texto $_POST ['texto'];


if(
$asunto==NULL|$texto==NULL|$email==NULL) {
        echo 
"un campo está vacio.";
        
        }else{
 
// Datos del email
$_GET ['nombre'] = $nombre;
$nombre_origen    "tu nombre";
$email_origen     "tu correo";
//$email_copia      = $email;
//$email_ocultos    = $email;
//$email_destino    = "".$row['email']."";  
$email_destino    $_POST ['email'];  
$asunto           $asunto;
$mensaje          $texto;
$formato          "html";

//*****************************************************************//
$headers  "From: $nombre_origen <$email_origen> \r\n";
$headers .= "Return-Path: <$email_origen> \r\n";
$headers .= "Reply-To: $email_origen \r\n";
$headers .= "X-Sender: $email_origen \r\n";
$headers .= "X-Priority: 3 \r\n";
$headers .= "MIME-Version: 1.0 \r\n";
$headers .= "Content-Transfer-Encoding: 7bit \r\n";

//*****************************************************************//
 
if($formato == "html")
 { 
$headers .= "Content-Type: text/html; charset=iso-8859-1 \r\n";  }
   else
    { 
$headers .= "Content-Type: text/plain; charset=iso-8859-1 \r\n";  }

if (@
mail($email_destino$asunto$mensaje$headers)) 
    { 
    echo 
"email enviado con exito";
    
    } 
     
            

                
                
                
  }    
}
            








?>
                        </div></td>
                  </tr>
                </table>
                <p>&nbsp;</p></td>
            </tr>
            <tr>
              <td height="30" colspan="3" bgcolor="#cccccc"><div align="center" class="Estilo23">Enviar email de contestacion de:</div></td>
              </tr>
            <tr>
              <td colspan="3"></td>
              </tr>
            
            <tr>
              <td height="29" colspan="3" align="center" class="Estilo18"><form id="contestar_centroki" name="contestar_centroki" method="post" action="contestar_form_centro.php">
                <table width="572" border="0" cellpadding="0" cellspacing="0">
                  <tr>
                    <td height="18" colspan="3" class="Estilo23">&nbsp;</td>
                  </tr>
                  <tr>
                    <td height="27" colspan="3" bgcolor="#6699FF" class="Estilo23"><div align="center">
                    
                                        
                    </div></td>
                  </tr>
                  <tr>
                    <td height="37" colspan="3" class="Estilo17"><div align="center" class="Estilo30">Mandar email</div></td>
                    </tr>
                  <tr>
                    <td width="42" class="Estilo18">email</td>
                    <td width="288"><label>
                      <input name="email" type="text" class="estilotextarea471" id="email" value="<? echo $email?>" size="40"/>
                    </label></td>
                    <td width="181">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td align="center"><label></label></td>
                  </tr>
                  <tr>
                    <td height="24" class="Estilo18">Asunto</td>
                    <td><label>
                        <input name="asunto" type="text" class="estilotextarea4" id="asunto" size="60" />
                          </label>                        </td>
                   <td align="center">&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                     <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td>Texto del email</td>
                    <td><label>
                      <textarea name="texto" cols="60" rows="10" class="estilotextarea41" id="texto"></textarea>
                    </label></td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr>
                    <td>&nbsp;</td>
                    <td><div align="center">
                      <input type="submit" name="button" id="button" value="Enviar" />
                    </div></td>
                    <td>&nbsp;</td>
                  </tr>
                 </table>
              </form>
Y ya creo que estamos escribiendo demasiado codigo