Domain: amberpublishers.in
Server Adress: 86.38.243.169
privdayz.com
<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'PHPMailer/src/Exception.php';
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';
include 'common/scripts.php';
function send_mail($email, $subject, $message, $name){
$mail = new PHPMailer(true);
try {
//Server settings
// $mail->SMTPDebug = 0; // Enable verbose debug output
$mail->isSMTP(); // Send using SMTP
$mail->Host = 'smtp.hostinger.com'; // SMTP server
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '[email protected]'; // SMTP username
$mail->Password = 'G-Sizzelers#2023'; // SMTP password
$mail->SMTPSecure = 'SSL/TLS'; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` also accepted
$mail->Port = 465; // TCP port to connect to
//Recipients
$mail->setFrom($email, 'G-Sizzeler Contact Form');
$mail->addAddress('[email protected]'); // Add a recipient [email protected]
$mail->addReplyTo($email, $name);
// Content
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = $subject;
$mail->Body = "
<table style = 'background-color:#252525ef;font-family: Nunito, sans-serif;width: 100%;padding: 50px 10px;'>
<tr>
<th colspan='2' style='color: #FFFFFF;padding: 5px 10px; width: 40px; align: center' ><img src='https://gsizzelers.com/assets/img/logo/logo.png' alt='G-Sizzelers Logo' width='50'></th>
</tr>
<tr>
<th colspan='2' style='color: #FFFFFF;padding: 5px 10px;font-size:20px'>Dear Manager</th>
</tr>
<tr>
<td colspan='3' style='color: #FFFFFF;text-align: center;'><strong>".$name."</strong> Just Filled the Contact Us Form On G-Sizzelers Website</td>
</tr>
<tr>
<td colspan='3' style='color: #FFFFFF;text-align: center;'>You Have Recieved a Message From: <strong>".$name."</strong></td>
</tr>
<tr>
<td colspan='3' style='color: #FFFFFF;text-align: center;'> <h3>Email:</h3><strong>".$email."</strong></td>
</tr>
<tr>
<td colspan='3' style='color: #FFFFFF;text-align: center;'><h3>Message: </h3><strong>".$message."</strong></td>
</tr>
<tr>
<th colspan='2' style='color: #FFFFFF;padding-top: 40px;'><span style='background-color:#4db8ff;padding: 8px 25px;font-size:25px;'><a href='www.gsizzelers.com' style='color: white;'>Visit Website</a></span></th>
</tr>
</table>
";
$mail->send();
//alert message using sweetalert and give message using ajax function
return true;
} catch (Exception $e) {
//call dangerfunction
// DangerFun("Message could not be sent. Error: {$mail->ErrorInfo}");
return false;
}
}
// ---------------------------- Message Function Start--------------------
function SuccessFun($Message)
{
echo "
<div class='alert alert-success alert-dismissible fade show' role='alert'>
<strong>$Message</strong>
<button type='button' class='close' data-dismiss='alert' aria-label='Close'>
<span aria-hidden='true'>×</span>
</button>
</div>
";
echo "<script>
if (window.history.replaceState) {
window.history.replaceState(null, null, window.location.href)
}
</script>";
}
function DangerFun($Message)
{
echo "
<div class='alert alert-danger alert-dismissible fade show' role='alert'>
<strong>$Message</strong>
<button type='button' class='close' data-dismiss='alert' aria-label='Close'>
<span aria-hidden='true'>×</span>
</button>
</div>
";
echo "<script>
if (window.history.replaceState) {
window.history.replaceState(null, null, window.location.href)
}
</script>";
}
?>
<!-- //include jquery from vendor -->
<script src="assets/vendor/jquery/jquery.min.js"></script>
