Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //$nombre = $_POST['name'];
- //$email = $_POST['email'];
- //$telefono = $_POST['phone'];
- //$webside = $_POST['webside'];
- //$mensaje = $_POST['message'];
- //$asunto = 'Envio de Comentarios';
- require 'PHPMailer-master/PHPMailerAutoload.php';
- //sendMail($email, $asunto, $mensaje, $nombre, $telefono, $webside);
- function sendMail($fromto, $subject, $content, $name, $telefono){
- try{
- $mail = new PHPMailer(true);
- $mail->Mailer="smtp";
- $mail->SMTPDebug = 0;
- $mail->Host = 'smtp.gmail.com';
- $mail->Port = 587;
- $mail->SMTPSecure = 'tls';
- $mail->SMTPAuth = true;
- $mail->Username = "seasensespa@gmail.com";
- $mail->Password = "123456";
- $mail->setFrom('cenjusus1233@gmail.com', 'jesus cen');
- $mail->addAddress('cenjusus1233@gmail.com', 'John');
- //$mail->addAddress($fromto, $name);
- //$mail->addCC($fromto,$name);
- //Set the subject line
- $mail->Subject = 'Mensaje de contacto de Sea Sense Spa';
- $content = body($subject, $content, $fromto, $name, $telefono);
- $mail->msgHTML($content);
- if (!$mail->send()) {
- echo "denied";
- } else {
- echo "success";
- }
- }catch(phpmailerException $e)
- {
- echo $e->errorMessage();
- }
- }
- function body($subject, $content, $email, $name, $telefono){
- $body="
- <html>
- <head>
- <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
- </head>
- <table style='border: 2px solid #00B9EA; width:50%'>
- <th style='background: #00B9EA; color: white; width:80%'><h2> Sea Sense Spa</h2></th>
- <tr>
- <td><center><b>Informacion</b></center><br></td></tr>
- <tr>
- <td style='border-top:1px solid #00B9EA'><strong>Nombre: </strong><br>
- <p>$name</p><br>
- </td>
- </tr>
- <tr>
- <td style='border-top:1px solid #00B9EA'><strong>Asunto: </strong><br>
- <p>$subject</p><br>
- </td>
- </tr>
- <tr>
- <td style='border-top:1px solid #00B9EA'><strong>Email: </strong><br>
- <p>$email</p><br></td>
- </tr>
- <tr>
- <td style='border-top:1px solid #00B9EA'><strong>Telefono: </strong><br>
- <p>$telefono</p><br></td>
- </tr>
- <tr>
- <td style='border-top:1px solid #00B9EA'><strong>Mensaje: </strong><br>
- <p>$content</p><br></td>
- </tr>
- <tr>
- <td style='border-top:5px solid #00B9EA'>Este mensaje fue enviado desde el sitio web de Sea Sense Spa</td>
- </tr>
- </table>
- </html>";
- return $body;
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement