📄 phpmailerInclude.php

Size: 1,777 bytes
Path: /home/islandholiday/public_html/admin/panel/phpmailerInclude.php
Modified: 2023-07-09 11:32:40
<?php


 
//include("phpmailerInclude.php");


use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception; 

require 'mail/src/Exception.php';
require 'mail/src/PHPMailer.php';
require 'mail/src/SMTP.php'; 

//$mail = new PHPMailer\PHPMailer\PHPMailer();
$mail = new PHPMailer;
$mail->isSMTP();  
$mail->SMTPDebug = 0; // 0 = off (for production use) - 1 = client messages - 2 = client and server messages
$mail->Host = "mail.saidpolyglottours.co.tz"; // use $mail->Host = gethostbyname('smtp.gmail.com'); // if your network does not support SMTP over IPv6
$mail->Port = 465; // TLS only
$mail->SMTPSecure = 'tls'; // ssl is depracated
$mail->SMTPAuth = true;
$mail->Username = "no-reply@saidpolyglottours.co.tz";
$mail->Password = "~a-Ca6VK*QI3";
$mail->setFrom("info@saidpolyglottours.co.tz", "Said Polyglot Tours & Safaris"); //email from
$mail->addAddress($Clientemail,$fullName); //email to
$mail->addAddress("info@saidpolyglottours.co.tz"); //email to
//$mail->addAddress("info@mtututours.co.tz"); //email to
//$mail->addAddress("bookings@mtututours.co.tz"); //email to
//$mail->addReplyTo("info@tumtours.co.tz","Tum Tours "); // replyto
//$mail->addCC(,""); //Cc


$mail->isHTML(true);                                  // Set email format to HTML

$mail->Subject = $subject;
$mail->Body    = $htmlEmail;
$mail->AltBody = $htmlEmail;

//$mail->msgHTML("test body"); 
//$mail->msgHTML(file_get_contents('contents.html'), __DIR__); //Read an HTML message body from an external file, convert referenced images to embedded,
//$mail->AltBody = 'HTML messaging not supported';
// $mail->addAttachment('images/phpmailer_mini.png'); //Attach an image file

if (!$mail->send()) {
    //echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
    //echo 'Message sent!';
}
;?>