
PK 
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
require 'PHPMailer/PHPMailer.php';
require 'PHPMailer/SMTP.php';
require 'PHPMailer/Exception.php';
class FUNCTIONS {
public function sendMail($to=NULL,$subject=NULL,$messagebody=NULL){
$mail = new PHPMailer();
//Server settings
//$mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output
$mail->isSMTP(); //Send using SMTP
$mail->Host = 'smtp.zoho.com'; //Set the SMTP server to send through
$mail->SMTPAuth = true; //Enable SMTP authentication
$mail->Username = 'info@serenatravels.in'; //SMTP username
$mail->Password = 'Virender@51'; //SMTP password
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; //Enable implicit TLS encryption
$mail->Port = 587; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
//Recipients
$mail->setFrom("info@serenatravels.in", "Serena Travels");
$mail->addAddress('info@serenatravels.in');
//$mail->addAddress("$to"); //Add a recipient
//$mail->addAddress("artistgourav91@gmail.com"); //Name is optional
//$mail->addBCC("bcc@example.com");
//Attachments
//$mail->addAttachment("/var/tmp/file.tar.gz"); //Add attachments
//$mail->addAttachment("/tmp/image.jpg", "new.jpg"); //Optional name
//Content
$mail->isHTML(true); //Set email format to HTML
$mail->Subject = "$subject";
$mail->Body = "$messagebody";
//$mail->AltBody = "This is the body in plain text for non-HTML mail clients";
//$mail->send();
if(!$mail->Send()) {
//echo "Message could not be sent. <p>";
//echo "Mailer Error: " . $mail->ErrorInfo;
//exit;
return 0;
}
//echo "Message has been sent";
return 1;
}
}
?>


PK 99