isSMTP(); //Send using SMTP
$mail->Host = 'smtp.gmail.com'; //Set the SMTP server to send through
$mail->SMTPAuth = true; //Enable SMTP authentication
$mail->Username = 'pavanmalvi48@gmail.com'; //SMTP username
$mail->Password = 'tazg oxqg raue lzvo'; //SMTP password
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption
$mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
//Recipients
$mail->setFrom('pavanmalvi48@gmail.com', 'Contact Form');
$mail->addAddress('ahmed@aimzenterprises.com', 'AIMZ Enterprises'); //Add a recipient
//Content
$mail->isHTML(true); //Set email format to HTML
$mail->Subject = 'Enquiry From AIMZ Enterprises Website';
$mail->Body = "Sender Name - $name
Sender email - $email
Sender phone - $phone
companyname - $companyname
message - $message
country - $country
city - $city
segment - $segment";
$mail->send();
echo"";
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
}
?>
Do you need free Consultation?