Mini Shell
<?php
// require './Exception.php';
require './mail/src/Exception.php';
require './mail/src/PHPMailer.php';
require './mail/src/SMTP.php';
// Import PHPMailer classes into the current namespace
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
// use PHPMailer\PHPMailer\PHPMailer;
// use PHPMailer\PHPMailer\Exception;
$targetDirectory = "../uploads/";
$response = array();
$username = $_POST['username'] ?? '';
$email = $_POST['email'] ?? '';
$phone = $_POST['phone'] ?? '';
$subject = $_POST['subject'] ?? '';
$message = $_POST['message'] ?? '';
$response['status'] = '200';
// $response['message'] = "The file has been uploaded.";
$mail = new PHPMailer(true);
try {
$mail->isSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = 'seyfertdeveloperteam@gmail.com';
$mail->Password = 'sigy euxl gzsb qeeo';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
$mail->SMTPDebug = 0;
// Recipients
$mail->setFrom('seyfertdeveloperteam@gmail.com', 'SriAravindarCollege');
$mail->addAddress('arulramalingam06@gmail.com');
// Content
$mail->isHTML(true);
$mail->Subject = 'Contact Form';
// $mail->Body = "Dear Your registration is successful.\n\nUsername : \nPassword: ";
$mail->Body = "<html>
<head>
<style>
.content {
font-family: Arial, sans-serif;
background-color: #f7f7f7;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
max-width: 600px;
margin: 0 auto;
}
.section-title {
font-weight: bold;
color: #333333;
margin-bottom: 5px;
}
.info {
margin-left: 10px;
color: #666666;
}
.cover-letter {
margin-top: 10px;
}
.action {
margin-top: 20px;
text-align: center;
}
.button {
display: inline-block;
padding: 10px 20px;
background-color: #fa4318;
color: #ffffff;
text-decoration: none;
border-radius: 5px;
}
</style>
</head>
<body class='content'>
<p class='section-title'>Dear Team,</p>
<p>We've received a new Contact form submission. Please review and process accordingly.</p>
<p class='section-title'>Applicant Name:</p>
<p class='info'>$username</p>
<p class='section-title'>Email:</p>
<p class='info'>$email</p>
<p class='section-title'>subject:</p>
<p class='info'>$subject</p>
<p class='section-title'>Phone:</p>
<p class='info'>$phone</p>
<p class='section-title'>Message:</p>
<p class='info cover-letter'>$message</p>
</body>
</html>";
$mail->send();
$response['email_status'] = "Email sent successfully";
} catch (Exception $e) {
$response['email_status'] = "Error sending email: {$e->getMessage()}";
}
// Send the JSON response
header('Content-Type: application/json');
echo json_encode($response);
Zerion Mini Shell 1.0