Advertisement
Guest User

Untitled

a guest
Aug 25th, 2016
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.50 KB | None | 0 0
  1. <?php
  2.  
  3. //$nombre = $_POST['name'];
  4. //$email = $_POST['email'];
  5. //$telefono = $_POST['phone'];
  6. //$webside = $_POST['webside'];
  7. //$mensaje = $_POST['message'];
  8. //$asunto = 'Envio de Comentarios';
  9.  
  10.  
  11. require 'PHPMailer-master/PHPMailerAutoload.php';
  12.  
  13. //sendMail($email, $asunto, $mensaje, $nombre, $telefono, $webside);
  14.  
  15. function sendMail($fromto, $subject, $content, $name, $telefono){
  16.  
  17. try{
  18.  
  19. $mail = new PHPMailer(true);
  20.  
  21. $mail->Mailer="smtp";
  22.  
  23. $mail->SMTPDebug = 0;
  24.  
  25. $mail->Host = 'smtp.gmail.com';
  26.  
  27. $mail->Port = 587;
  28.  
  29. $mail->SMTPSecure = 'tls';
  30.  
  31. $mail->SMTPAuth = true;
  32.  
  33. $mail->Username = "seasensespa@gmail.com";
  34.  
  35. $mail->Password = "123456";
  36.  
  37. $mail->setFrom('cenjusus1233@gmail.com', 'jesus cen');
  38. $mail->addAddress('cenjusus1233@gmail.com', 'John');
  39. //$mail->addAddress($fromto, $name);
  40. //$mail->addCC($fromto,$name);
  41.  
  42. //Set the subject line
  43. $mail->Subject = 'Mensaje de contacto de Sea Sense Spa';
  44.  
  45. $content = body($subject, $content, $fromto, $name, $telefono);
  46.  
  47. $mail->msgHTML($content);
  48.  
  49. if (!$mail->send()) {
  50. echo "denied";
  51.  
  52. } else {
  53. echo "success";
  54.  
  55.  
  56. }
  57.  
  58.  
  59. }catch(phpmailerException $e)
  60. {
  61. echo $e->errorMessage();
  62.  
  63. }
  64.  
  65.  
  66. }
  67.  
  68.  
  69. function body($subject, $content, $email, $name, $telefono){
  70.  
  71. $body="
  72. <html>
  73. <head>
  74. <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
  75. </head>
  76. <table style='border: 2px solid #00B9EA; width:50%'>
  77. <th style='background: #00B9EA; color: white; width:80%'><h2> Sea Sense Spa</h2></th>
  78. <tr>
  79. <td><center><b>Informacion</b></center><br></td></tr>
  80. <tr>
  81. <td style='border-top:1px solid #00B9EA'><strong>Nombre: </strong><br>
  82. <p>$name</p><br>
  83. </td>
  84. </tr>
  85. <tr>
  86. <td style='border-top:1px solid #00B9EA'><strong>Asunto: </strong><br>
  87. <p>$subject</p><br>
  88. </td>
  89. </tr>
  90. <tr>
  91. <td style='border-top:1px solid #00B9EA'><strong>Email: </strong><br>
  92. <p>$email</p><br></td>
  93. </tr>
  94. <tr>
  95. <td style='border-top:1px solid #00B9EA'><strong>Telefono: </strong><br>
  96. <p>$telefono</p><br></td>
  97. </tr>
  98. <tr>
  99. <td style='border-top:1px solid #00B9EA'><strong>Mensaje: </strong><br>
  100. <p>$content</p><br></td>
  101. </tr>
  102. <tr>
  103. <td style='border-top:5px solid #00B9EA'>Este mensaje fue enviado desde el sitio web de Sea Sense Spa</td>
  104. </tr>
  105. </table>
  106. </html>";
  107.  
  108. return $body;
  109.  
  110. }
  111.  
  112.  
  113. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement