<?php
// http://phpmailer.worxware.com/?pg=examplebsmtp
$name = $_POST['name'] ;
$phone = $_POST['phone'] ;
$message = $name . '<br>' . $phone . '<br>' . $_POST['message'] ;
require 'PHPMailerAutoload.php';
//PHPMailer Object
$mail = new PHPMailer;
// Instantiate Class
$mail = new PHPMailer();
// Set up SMTP
$mail->IsSMTP(); // Sets up a SMTP connection
$mail->SMTPDebug = 2; // This will print debugging info
$mail->SMTPAuth = true; // Connection with the SMTP does require authorization
$mail->SMTPSecure = "tls"; // Connect using a TLS connection
$mail->Host = "smtp.gmail.com";
$mail->Port = 587;
$mail->Encoding = '7bit'; // SMS uses 7-bit encoding
// set email format to HTML
$mail->IsHTML(true);
// Authentication
$mail->Username = "juan@popcreativegroup.com"; // Login
$mail->Password = "popjuan7480#"; // Password
// Compose
$mail->AddReplyTo("alex@popcreativegroup.com","7866835225");
// $mail->setFrom('popadmin@popcreativegroup.com', 'POP Admin');
$mail->setFrom('popadmin@popcreativegroup.com', $name ) ;
$mail->Subject = "New Mobile Message"; // Subject (which isn't required)
$mail->Body = $message; // Body of our message
// Send To alex
$mail->AddAddress( "7866835225@txt.att.net" ); // Where to send it
//$mail->AddAddress( "juan@popcreativegroup.com" ); // Where to send it
if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "<br><br>Thank you for contacting us. We will be in touch with you very soon.";