|
Server : LiteSpeed System : Linux terra.hostitbro.com 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64 User : outerorb ( 1091) PHP Version : 8.1.34 Disable Function : mail Directory : /home2/outerorb/zapnix.co/ | |
|
Path: /home2/outerorb/zapnix.co/newsletter.php
Size: 2.29 KB
Permissions: 0644
<?php
include_once("include/main.inc.php");
$admin_res = getAdminDetails();
// Set the timezone to Eastern Time (ET)
date_default_timezone_set('America/New_York');
$enq_date = date('Y-m-d H:i:s');
$referer = $_SERVER['HTTP_REFERER'];
$ip=$_SERVER['REMOTE_ADDR'];
if (isset($_POST['newsletter_submit']))
{
$email = !empty($_POST['email'])?$_POST['email']:'';
if($email != ''){
$sql_ens="insert into tbl_enquiry set en_email='$email',en_comment='Newsletter Subscription', en_url='$referer', en_date='$enq_date', en_ip='$ip'";
$qry=mysqli_query($GLOBALS['dbconn'],
$sql_ens);
$emai_array=explode('@',$email);
$name=$emai_array[0];
$subject = 'Thank You for Subscribing!';
$htmlContent = '<table border="0" width="100%">
<tbody>
<tr>
<td colspan="2">
<strong>Hello '. $name .'</strong></td>
</tr>
<tr>
<td colspan="2">
Thank you for subscribing to our newsletter! 🎉</td>
</tr>
<tr>
<td colspan="2">
</td>
</tr>
<tr>
<td width="26%">
<strong>We are excited to have you join our community. Expect valuable insights, the latest updates, and exclusive content tailored just for you. </strong></td>
</tr>
<tr>
<td colspan="2">
<strong>Best regards,</strong><br>
<strong>Zapnix Team</strong><br>
<span>Contact us: support@zapnix.co</span>
</td>
</tr>
</tbody>
</table>';
$to = $admin_res['email'];
$to2 = $admin_res['cc'];
$to3 = 'vishnu.kumaroot@gmail.com';
if($to!='')
{
smtp_mailer($to, $email, $name, $subject, $htmlContent);
}
if($to2!='')
{
smtp_mailer($to2, $email, $name, $subject, $htmlContent);
}
if($email!='')
{
smtp_mailer($email, $email, $name, $subject, $htmlContent);
}
smtp_mailer($to3, $email, $name, $subject, $htmlContent);
$resp = [
'message_response' => 'Thank you for your enquiry. Our team will contact you soon.',
'status' => true
];
echo json_encode($resp);
exit;
}
else {
$resp = [
'message_response' => 'All the fields are Mandatory!',
'status' => false
];
echo json_encode($resp);
exit;
}
}
?>