Advertisement
Guest User

Untitled

a guest
Oct 1st, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. <?php
  2. $nombre = $_POST['name'];
  3. $email = $_POST['email'];
  4. $mensaje = $_POST['message'];
  5. $to = 'martinpalmieri@gmail.com';
  6. $titulo = 'ASUNTO DEL MENSAJE';
  7. $header = 'From: ' . $email;
  8. $msjCorreo = "Nombre: $name\n E-Mail: $email\n Mensaje:\n $message";
  9.  
  10. require("class.phpmailer.php");
  11.  
  12. $mail=new PHPMailer();
  13.  
  14. $mail->IsSMTP();
  15.  
  16. $mail->SMTPAuth=true;
  17.  
  18. $mail->Host="distrisoft.com.ar";
  19.  
  20. $mail->Username="distrisoft@distrisoft.com.ar"; // usuario correo remitente
  21.  
  22. $mail->Password="alkimia2014"; // contraseÒa correo remitente
  23.  
  24. $mail->Port=25;
  25.  
  26. $mail->From="info@istrisoft.com.ar"; // correo remitente
  27.  
  28. $mail->FromName="nombre"; // nombre remitente
  29.  
  30. $mail->AddAddress("martinpalmieri@gmail.com"); // destinatario
  31.  
  32. $mail->IsHTML(true);
  33.  
  34. $mail->Subject="Contacto via web";
  35.  
  36.  
  37.  
  38. $body.= nl2br("Nombre y Apellido: \n$nombre $apellido");
  39.  
  40. $body.= nl2br("\n\nCorreo:\n$email");
  41.  
  42. $body.= nl2br("\n\nTelefono:\n$telefono");
  43.  
  44. $body.= nl2br("\n\nEmpresa:\n$empresa");
  45.  
  46. $body.= nl2br("\n\nConsulta:\n$message");
  47.  
  48. $mail->Body=$body; // mensaje
  49.  
  50. $enviar = $mail->Send(); // envia el correo
  51.  
  52.  
  53. if ($_POST['submit']) {
  54. if (mail($to, $titulo, $msjCorreo, $header)) {
  55. echo "<script language='javascript'>
  56. alert('Mensaje enviado, muchas gracias.');
  57. window.location.href = 'http://distrisoft.com.ar';
  58. </script>";
  59. } else {
  60. echo 'Falló el envio';
  61. }
  62. }
  63. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement