Guest User

Untitled

a guest
Feb 16th, 2018
480
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.48 KB | None | 0 0
  1. <?php
  2. require 'PHPMailerAutoload.php';
  3. require 'class.smtp.php';
  4. require 'class.phpmailer.php';
  5.  
  6. $mail = new PHPMailer;
  7. //Vars
  8. $name=$_POST['name'];
  9. $email=$_POST['email'];
  10. $msg=$_POST['message'];
  11.  
  12. //$mail->SMTPDebug = 3; // Enable verbose debug output
  13.  
  14. $mail->isSMTP(); // Set mailer to use SMTP
  15. $mail->Host = 'smtp.correoseguro.co;smtp.likemedia.com.ar'; // Specify main and backup SMTP servers
  16. $mail->SMTPAuth = true; // Enable SMTP authentication
  17. $mail->Username = 'salvador@likemedia.com.ar'; // SMTP username
  18. $mail->Password = 'Salvatore95'; // SMTP password
  19. $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted
  20. $mail->Port = 465; // TCP port to connect to
  21.  
  22. $mail->setFrom('salvador@likemedia.com.ar', 'PERALTA RAMOS');
  23. $mail->addAddress('salvador@likemedia.com.ar'); // Name is optional
  24. $mail->isHTML(true); // Set email format to HTML
  25.  
  26. $mail->Subject = $msubject;
  27. $mail->Body = "Nombre: " . $name . "rn" . "Mail: " . $email . "rn" . "Mensaje: " . $msg;
  28.  
  29. if(!$mail->send()) {
  30. echo 'No se pudo enviar el mail';
  31. echo 'Mailer Error: ' . $mail->ErrorInfo;
  32. } else {
  33. echo 'El mail ha sido enviado exitosamente!';
  34. }
  35.  
  36. //$exito = $mail->Send(); // Envía el correo.
  37. //if($exito){
  38. //echo "El correo fue enviado correctamente.";
  39. //}else{
  40. //echo "Hubo un inconveniente. Contacta a un administrador.";
  41. //}
  42. //?>
  43.  
  44. <!-- Contact -->
  45. <article id="contact">
  46. <h2 class="major">Contacto</h2>
  47. <form method="post" action="PHPMailer/contacto.php">
  48. <div class="field half first">
  49. <label for="name">NOMBRE</label>
  50. <input type="text" name="name" id="name" />
  51. </div>
  52. <div class="field half">
  53. <label for="email">MAIL</label>
  54. <input type="text" name="email" id="email" />
  55. </div>
  56. <div class="field">
  57. <label for="message">MENSAJE</label>
  58. <textarea name="message" id="message" rows="4"></textarea>
  59. </div>
  60. <ul class="actions">
  61. <li><input type="submit" value="ENVIAR" class="special" /></li>
  62. <li><input type="reset" value="LIMPIAR" /></li>
  63. </ul>
  64. </form>
  65. <ul class="icons">
  66. <li><a href="https://www.facebook.com/salva.castro95" class="icon fa-facebook"><span class="label">Facebook</span></a></li>
  67. <li><a href="https://www.twitter.com/salva_castro95" class="icon fa-twitter"><span class="label">Twitter</span></a></li>
  68. <li><a href="https://www.instragram.com/salva_castro95" class="icon fa-instagram"><span class="label">Instagram</span></a></li>
  69. </ul>
  70. </article>
Add Comment
Please, Sign In to add comment