Advertisement
Guest User

Untitled

a guest
Apr 18th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. <?php
  2. if(isset($_POST['year']))
  3. {
  4. require 'phpmailer/PHPMailerAutoload.php';
  5.  
  6. $mail = new PHPMailer;
  7.  
  8. //$mail->SMTPDebug = 3; // Enable verbose debug output
  9.  
  10. $mail->isSMTP(); // Set mailer to use SMTP
  11. $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
  12. $mail->SMTPAuth = true; // Enable SMTP authentication
  13. $mail->Username = 'car.noreply1@gmail.com'; // SMTP username
  14. $mail->Password = 'carreply'; // SMTP password
  15. $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
  16. $mail->Port = 587; // TCP port to connect to
  17.  
  18. $mail->setFrom('car.noreply1@gmail.com', 'Mailer');
  19. //$mail->addAddress('car.noreply1@gmail.com', 'Joe User');
  20. $mail->addAddress('car.noreply1@gmail.com', 'CarNation');
  21.  
  22.  
  23.  
  24. $mail->Subject = 'Inquiry';
  25. $mail->Body = 'Year: '.$_POST['year']."\n".
  26. 'Model: '.$_POST['model']."\n".
  27. 'Model: '.$_POST['mileage']."\n".
  28. 'First Name: '.$_POST['first_name']."\n".
  29. 'Last Name: '.$_POST['last_name']."\n".
  30. 'Email: '.$_POST['email']."\n".
  31. 'Phone Number: '.$_POST['phone_number'];
  32.  
  33. if(!$mail->send()) {
  34. echo 0;
  35. } else {
  36.  
  37. echo 1;
  38. }
  39.  
  40. }
  41. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement