Ver Mensaje Individual
  #3 (permalink)  
Antiguo 29/01/2015, 09:04
argosca
 
Fecha de Ingreso: julio-2006
Mensajes: 31
Antigüedad: 17 años, 9 meses
Puntos: 0
Respuesta: formulario de contacto

voy a poner el codigo.
donde dice empresa seria la institucion donde trabajo
[email protected] me dicen que es a donde llega copia del formulario
ayduda
gracias

Código PHP:
<?php
require_once("../init.php");
require_once 
'../include/classes/phpmailer/class.phpmailer.php';
if(
$_POST){

    
$nom=secure_post($_POST["nombre"]);
    
$empresa=secure_post($_POST["empresa"]);
    
$tel=secure_post($_POST["tel"]);
    
$email=secure_post($_POST["email"]);
    
$motivo=(int)$_POST["motivo"];
    
$com=secure_post($_POST["consulta"]);
    
$ip get_ip();
    
$arr= array(=> "Informaci&oacute;n general"=> "Comentarios y Sugerencias",=> "Reclamos");
    
$str_motivo=$arr[$motivo];
    
$body="Mensaje enviado desde $ip";
    
$body.="Datos:<br>--------------------------------<br>";
    
$body.="Nombres:<strong>$nom</strong><br>";
    
$body.="Empresa:<strong>$empresa</strong><br>";    
    
$body.="Tel&eacute;fono:$tel<br>";
    
$body.="Email:$email<br>";
    
$body.="Motivo de Contacto:<strong>$str_motivo</strong><br>";    
    
$body.="Comentario:<br>$com<br>";


    
$mail = new PHPMailer(true); //defaults to using php "mail()"; the true param means it will throw exceptions on errors, which we need to catch
    
    
try {
      
//$mail*>AddReplyTo("[email protected]","Nombre Completo");
      // $mail->AddCC("[email protected]");
      //$mail->AddBCC('[email protected]','AV');
          
$mail->AddAddress("[email protected]","empresa");
          
//$mail->AddAddress("[email protected]");
      
$mail->SetFrom('[email protected]''[email protected]');
      
$mail->Subject 'Nueva solicitud - Formulario de Empleo';
      
//$mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
      //$body="demo demo";
      
$mail->MsgHTML($body);
      
//$mail->AddAttachment('images/phpmailer.gif');      // attachment
      //$mail->AddAttachment('images/phpmailer_mini.gif'); // attachment
      
if($mail->Send())
      
OK("Muchas Gracias por su comunicaci&oacute;n. Nos comunicaremos con usted a la brevedad posible!");    
      else echo 
$mail->ErrorInfo;
      
//echo "Message Sent OK\n";
    
} catch (phpmailerException $e) {
      
ERROR($e->errorMessage());
      
//echo $e->errorMessage(); //Pretty error messages from PHPMailer
    

    
}
?>