-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update manage-contact-queries-send-reply.php
removed email information
- Loading branch information
1 parent
e2a394c
commit d952b23
Showing
1 changed file
with
9 additions
and
62 deletions.
There are no files selected for viewing
71 changes: 9 additions & 62 deletions
71
account/configure-site/manage-contact-queries-send-reply.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,17 @@ | ||
<?php | ||
use PHPMailer\PHPMailer\PHPMailer; | ||
use PHPMailer\PHPMailer\SMTP; | ||
use PHPMailer\PHPMailer\Exception; | ||
|
||
require '../../PHPMailer/src/Exception.php'; | ||
require '../../PHPMailer/src/PHPMailer.php'; | ||
require '../../PHPMailer/src/SMTP.php'; | ||
|
||
include '../../connection.php'; | ||
|
||
|
||
$id = $_REQUEST['id']; | ||
|
||
|
||
$get = mysqli_query($conn,"SELECT * FROM contactus WHERE id='$id'"); | ||
while($row = mysqli_fetch_array($get)) | ||
{ | ||
$uname=$row['uname']; | ||
$emailid=$row['emailid']; | ||
$subject ="Reply from AASC to your Contacted Query"; | ||
$reply="Hello <b>" .$uname.", </b> <br><br> <b>Requested Query: ".$row['msg']."</b> <br><br> <b>Reply: </b>".$row['reply']; | ||
} | ||
|
||
|
||
|
||
// Load Composer's autoloader | ||
require '../../../../phpMyAdmin/vendor/autoload.php'; | ||
|
||
// Instantiation and passing `true` enables exceptions | ||
$mail = new PHPMailer(true); | ||
|
||
try { | ||
//Server settings | ||
$mail->SMTPDebug = SMTP::DEBUG_SERVER; // Enable verbose debug output | ||
$mail->isSMTP(); // Send using SMTP | ||
$mail->Host = 'smtp.gmail.com'; // Set the SMTP server to send through | ||
$mail->SMTPAuth = true; // Enable SMTP authentication | ||
$mail->Username = '[email protected]'; // SMTP username | ||
$mail->Password = 'jaihind123'; // SMTP password | ||
$mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged | ||
$mail->Port = 587; // TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above | ||
|
||
//Recipients | ||
$mail->setFrom('[email protected]', 'Admin-AASC'); | ||
$mail->addAddress($emailid, $uname); // Add a recipient | ||
//$mail->addAddress('[email protected]'); // Name is optional | ||
$mail->addReplyTo('[email protected]', 'Admin-AASC'); | ||
//$mail->addCC('[email protected]'); | ||
//$mail->addBCC('[email protected]'); | ||
|
||
// 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 = $reply; | ||
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients'; | ||
|
||
$mail->send(); | ||
|
||
echo '<script> alert("Message has been sent!")</script>'; | ||
|
||
} catch (Exception $e) { | ||
echo '<script> alert("Message could not be sent. Error: <!--{$mail->ErrorInfo}-->")</script>'; | ||
} | ||
$get = mysqli_query($conn,"SELECT * FROM contactus WHERE id='$id'"); | ||
while($row = mysqli_fetch_array($get)) | ||
{ | ||
$uname=$row['uname']; | ||
$emailid=$row['emailid']; | ||
$subject ="Reply from AASC to your Contacted Query"; | ||
$reply="Hello <b>" .$uname.", </b> <br><br> <b>Requested Query: ".$row['msg']."</b> <br><br> <b>Reply: </b>".$row['reply']; | ||
} | ||
|
||
?> | ||
?> |