Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/10/2011, 06:11
dgrobles
 
Fecha de Ingreso: octubre-2011
Mensajes: 3
Antigüedad: 12 años, 6 meses
Puntos: 0
Mail de autorespuesta PHP

Hola,

Tengo un formulario (hecho en flash) que envía un email a través de PHP con la información que recoge. Necesito que además, envío un email de autorespuesta al correo que recoge, del tipo... "Hemos recibido su email, en breve nos pondremos en contacto con uste"...

He probado de varias maneras y no consigo hacer que el email se envíe.

¿Alguien podría ayudarme?

Muchas gracias.

Tanscribo el PHP

Código PHP:
<?php


      
$nome 
stripslashes($_POST["nome"]); 
$correo $_POST["correo"]; 
$telefone stripslashes($_POST["telefone"]); 
$temas  explode(',',$_POST["temas"]); 
$comentarios $_POST["comentarios"]; 
$formatos = array("text/html""text/plain"); 
$remitente "email@servidor";  
$para "[email protected]";
$asunto "WEB - CONTATO"
$formato_correo 0
$header  "MIME-Version: 1.0\r\n";
$header .= "Content-type: " $formatos[$formato_correo] . "; charset=iso-8859-1\r\n";
$header .= "From: " $remitente "\n";


if(
$nombre != "" && $correo != "") { 
    if(
$formato_correo == 0) { 
        
$mensaje '
        <style type="text/css">
        <!--
        .Estilo1 {
            color: #000000;
            font-family: Arial;
            font-size: 12px;
        }
        .Estilo2 {
            color: #000000;
            font-family: Arial;
            font-weight: bold;
            font-size: 8px;
        }
        -->
        </style>
                
        <span class="Estilo1"><span class="Estilo2">' 
$asunto '</span></span><br />
        <br />
        <hr />
        <table width="438" border="0" cellspacing="0" cellpadding="0" class="Tabla_Contacto">
          <tr>
            <td width="400" class="Estilo1"><strong>Nome:</strong></td>
            <td width="500" class="Estilo1">' 
$nome '</td>
          </tr>
          <tr>
          <td width="400" class="Estilo1"><strong>Telefone:</strong></td>
            <td width="500" class="Estilo1">' 
$telefone '</td>
          </tr>
          <tr>
            <td class="Estilo1"><strong>Email:</strong></td>
            <td class="Estilo1">' 
$correo '</td>
                   </tr>
          <tr>
            <td class="Estilo1"><strong>Estado:</strong></td>
            <td class="Estilo1">' 
$pais '</td>
          </tr>
          <tr>
           <td width="400" class="Estilo1"><strong>Cidade:</strong></td>
            <td width="500" class="Estilo1">' 
$cidade '</td>    
        </tr>
          <tr>
           <td width="400" class="Estilo1"><strong>Mensagem:</strong></td>
            <td width="500" class="Estilo1">' 
$mensagem '</td>                                              
          </tr>
          <tr>
            <td class="Estilo1">&nbsp;</td>
            <td class="Estilo1">'

                for(
$i 0$i count($temas); $i++) {
                    
$mensaje .= $temas[$i] . "<br>"
                } 
$mensaje .=  '</td>
</tr>
        </table>
        <hr />
        <hr style="height:10px" />'
;
    
    }
    else { 
    
$mensaje "
----------------------------------------------------------------------------\n
Nome: " 
$nome "\n
Email: " 
$correo "\n
Telefone: " 
$telefone "\n
Estado: " 
$pais "\n
Cidade: " 
$cidade "\n
Mesagem: " 
$mensagem "\n
Tipologia / Padrão do produto: "

        for(
$i 0$i count($temas); $i++) {
            
$mensaje .= $temas[$i] . "\n"
        } 
$mensaje .=  "
----------------------------------------------------------------------------\n
"
;
    }
}

if(
$mensaje != "")
{
    if(
mail($para$asunto$mensaje$header))
        echo 
'&resultado=S&';
    else
        echo 
'&resultado=N&';
}
else
    echo 
'&resultado=N&';
    
?>