Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['year']))
- {
- require 'phpmailer/PHPMailerAutoload.php';
- $mail = new PHPMailer;
- //$mail->SMTPDebug = 3; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'car.noreply1@gmail.com'; // SMTP username
- $mail->Password = 'carreply'; // SMTP password
- $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 587; // TCP port to connect to
- $mail->setFrom('car.noreply1@gmail.com', 'Mailer');
- //$mail->addAddress('car.noreply1@gmail.com', 'Joe User');
- $mail->addAddress('car.noreply1@gmail.com', 'CarNation');
- $mail->Subject = 'Inquiry';
- $mail->Body = 'Year: '.$_POST['year']."\n".
- 'Model: '.$_POST['model']."\n".
- 'Model: '.$_POST['mileage']."\n".
- 'First Name: '.$_POST['first_name']."\n".
- 'Last Name: '.$_POST['last_name']."\n".
- 'Email: '.$_POST['email']."\n".
- 'Phone Number: '.$_POST['phone_number'];
- if(!$mail->send()) {
- echo 0;
- } else {
- echo 1;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement