[insert_php]
//echo “page working”;
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
//Load composer’s autoloader
require ‘/home/cshforcarswollo/public_html/carRemover/php/vendor/vendor/autoload.php’;
$cName = “”;
$cPhone= “”;
$cEmail = “”;
$cLocation = “”;
$cMessage = “”;
$cCaptchaCode = “”;
$cSecurityCode = “”;
//echo “
cName:”.$_POST[“fname”];
//echo “
cPhone:”.$_POST[“phone”];
//echo “
cEmail:”.$_POST[“email”];
//echo “
cLocation:”.$_POST[“location”];
//echo “
cMessage:”.$_POST[“message”];
//echo “
security:”.$_POST[“securityCode”];
//echo “
captcha:”.$_POST[“captchaCode”];
if($_SERVER[‘REQUEST_METHOD’]==’POST’)
{
$cName = $_POST[“fname”];
$cPhone = $_POST[“phone”];
$cEmail = $_POST[“email”];
$cLocation = $_POST[“location”];
$cMessage = $_POST[“message”];
$cCaptchaCode = $_POST[“captchaCode”];
$cSecurityCode = $_POST[“securityCode”];
if($cCaptchaCode==$cSecurityCode)
{
echo “
Captcha matched.”;
$fullMessage = “Dear admin,
You have received the following Free Quote request from cashforcarswollongong.com.au:”.”
”
.”Name : “.$cName.”
”
.”Phone : “.$cPhone.”
”
.”Email: “.$cEmail.”
”
.”Location: “.$cLocation.”
”
.”Message: “.$cMessage.”
”
.”Thanks
Cash For Cars Wollongong.
This e-mail was sent from the Get a Quote form of Cash for cars wollongong (cashforcarswollongong.com.au)”;
sendEmail($fullMessage);
}
else{
echo “
Captcha does not match. Please call 0455 120 045.”;
}
}
function sendEmail($message)
{
$mail = new PHPMailer(); // create a new object
//$mail->IsSMTP(); // enable SMTP
//$mail->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = ‘ssl’; // secure transfer enabled REQUIRED for Gmail
$mail->Host = “cashforcarswollongong.com.au”;
$mail->Port = 465; // or 587
$mail->IsHTML(true);
$mail->Username = “info@cashforcarswollongong.com.au”;
$mail->Password = “Cash@2018”;
$mail->SetFrom(“info@cashforcarswollongong.com.au”);
$mail->Subject = “Qoute Request From Cash for cars wollongong.”;
$mail->Body = $message;
$mail->AddAddress(“info@oneworldmetal.com.au”);
//$mail->addCC(“quazi.hasib13@gmail.com”);
$mail->addCC(“kazim@oneworldmetal.com.au”);
if(!$mail->Send()) {
echo “Mailer Error: ” . $mail->ErrorInfo;
echo “Sorry, your mail was not sent. Please call 0449 198 516.”;
} else {
echo “Thank you for your enquiry. One of our representatives will contact you soon.”;
}
}
[/insert_php]
