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(0 => "Información general", 1 => "Comentarios y Sugerencias",2 => "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é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ó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
}
}
?>