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.gmail.com'; // SMTP server
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = '[email protected]'; // SMTP username
$mail->Password = 'jokfdrcqznjgcroh'; // SMTP password
$mail->SMTPSecure = 'tls'; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` also accepted
$mail->Port = 587; // TCP port to connect to
//Recipients
$mail->setFrom($email, 'Amber 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://amberpublishers.in/assets/img/logo/favicon.png' alt='amber publishers logo' width='50'></th>
</tr>
<tr>
<th colspan='2' style='color: #FFFFFF;padding: 5px 10px;font-size:20px'>Dear Dr. Asghar Rizvi</th>
</tr>
<tr>
<td colspan='3' style='color: #FFFFFF;text-align: center;'><strong>".$name."</strong> Just Filled the Contact Us Form On Amber Publishers</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.amberpublishers.in' 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>";
}
// ---------------------------- Message Function end--------------------
function sendEmailWithAttachment($recipientEmail,$email, $recipientName, $subject, $body, $attachmentPath, $attachmentName) {
$mail = new PHPMailer(true);
try {
// SMTP configuration
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = '[email protected]';
$mail->Password = 'jokfdrcqznjgcroh';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
// Sender and recipient
$mail->setFrom($email, 'Amber Author');
$mail->addAddress($recipientEmail, $recipientName);
// Email content
$mail->isHTML(true);
$mail->Subject = $subject;
$mail->Body = $body;
// Attach the file
$mail->addAttachment($attachmentPath, $attachmentName);
// Send the email
$mail->send();
return true;
} catch (Exception $e) {
// Handle the exception
// error message
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
return false;
}
}
?>
<!-- //include jquery from vendor -->
<script src="assets/vendor/jquery/jquery.min.js"></script>
