Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- use PHPMailer\PHPMailer\PHPMailer;
- use PHPMailer\PHPMailer\Exception;
- $uri_path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
- $uri_segments = explode('/', $uri_path);
- if($uri_segments[2]=="customer"){
- require ('../vendor/autoload.php');
- require ('../vendor/phpmailer/phpmailer/src/Exception.php');
- require ('../vendor/phpmailer/phpmailer/src/PHPMailer.php');
- require ('../vendor/phpmailer/phpmailer/src/SMTP.php');
- }else{
- require ('vendor/autoload.php');
- require ('vendor/phpmailer/phpmailer/src/Exception.php');
- require ('vendor/phpmailer/phpmailer/src/PHPMailer.php');
- require ('vendor/phpmailer/phpmailer/src/SMTP.php');
- }
- function sendMail($customer_email,$title,$body,$name){
- $mail = new PHPMailer(true); // Passing `true` enables exceptions
- try {
- //Server settings
- $mail->SMTPDebug = 2; // Enable verbose debug output
- $mail->isSMTP(); // Set mailer to use SMTP
- $mail->Host = 'smtp.gmail.com'; // Specify main and backup SMTP servers
- $mail->SMTPAuth = true; // Enable SMTP authentication
- $mail->Username = 'volutionshop@gmail.com'; // SMTP username
- $mail->Password = 'komengku'; // SMTP password
- $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted
- $mail->Port = 587; // TCP port to connect to
- $mail->setFrom('volutionshop@gmail.com', 'Volution Admin');
- $mail->addAddress($customer_email, 'Customer');
- $mail->Subject = $title;
- $mail->isHTML(true);
- $server = $_SERVER['SERVER_NAME'];
- $mail->Body = "<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'
- 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
- <html xmlns='http://www.w3.org/1999/xhtml'>
- <head>
- <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'/>
- <title>Banned Account</title>
- <meta name='viewport' content='width=device-width, initial-scale=1.0'/>
- </head>
- <body style='margin:0; padding:10px 0 0 0;' bgcolor='#F8F8F8'>
- <table align='center' border='0' cellpadding='0' cellspacing='0' width='95%'>
- <tr>
- <td align='center'>
- <table align='center' border='0' cellpadding='0' cellspacing='0' width='600'
- style='border-collapse: separate; border-spacing: 2px 5px; box-shadow: 1px 0 1px 1px #B8B8B8;'
- bgcolor='#ffffff'>
- <tr>
- <td align='center' style='padding: 5px 5px 5px 5px;color: white;' bgcolor='#FF3232'>
- <a href='http://$server' target='_blank'>
- <img src='https://lh4.googleusercontent.com/zxQEAef4T610ttKs2U1trS0nO4KSufD7K5lC5t_HYkLleGWZc-_nZOOhFCdYU5QOdqLXxSC4CI-I05f05piO=w1366-h635' style='width:20%;border:0;margin-top:10px'/>
- </a>
- </td>
- </tr>
- <tr>
- <td bgcolor='#ffffff' style='padding: 40px 30px 40px 30px;'>
- <table border='0' cellpadding='0' cellspacing='0' width='100%%'>
- <tr>
- <td style='padding: 10px 0 10px 0; font-family: Avenir, sans-serif; font-size: 16px;text-align:justify;color:black;'>
- <!-- Initial text goes here-->
- <b><p>Hi $name,</p></b><br>
- $body
- <p>Best Regards,</p><br>
- <p>Volution Shop</p>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- <tr>
- <td bgcolor='#E8E8E8'>
- <table border='0' cellpadding='0' cellspacing='0' width='100%%' style='padding: 20px 10px 10px 10px;'>
- <tr>
- <td width='260' valign='top' style='padding: 0 0 15px 0;'>
- <table border='0' cellpadding='0' cellspacing='0' width='100%%'>
- <tr>
- <td align='center'>
- <a href='tel:+6287700896356' target='_blank'>
- <img src='https://lh6.googleusercontent.com/wnQhYWy5F4vDHBNtfSEf0CH1UNbY64w0uLoG2EltDhgEnyLjsetFxnayTzX_ZKidQ0Yv8Q6r8NhTodTBFDOY=w1366-h586' alt='Call us'
- style='display: block;height: 50px;width:50px'/>
- </a>
- </td>
- </tr>
- <tr>
- <td align='center'
- style='font-family: Avenir, sans-serif; color:#707070;font-size: 13px;padding: 10px 0 0 0;'>
- GIVE US A CALL
- </td>
- </tr>
- </table>
- </td>
- <td style='font-size: 0; line-height: 0;' width='20'>
-
- </td>
- <td width='260' valign='top' style='padding: 0 0 15px 0;'>
- <table border='0' cellpadding='0' cellspacing='0' width='100%%' >
- <tr>
- <td align='center'>
- <a href='mailto:volutionshop@gmail.com'>
- <img src='https://lh3.googleusercontent.com/D24K7rQFCRpE2owT1WBMNHYP0kMco_XuVM9I1ZAmhe3M5NQu5rdU6bz4IWjrnnXB93EgfceZiszCFylpAMb0=w1366-h586' alt='Call us'
- style='display: block;height: 50px;width:50px'/>
- </a>
- </td>
- </tr>
- <tr>
- <td align='center'
- style='font-family: Avenir, sans-serif; color:#707070;font-size: 13px;padding: 10px 0 0 0;'>
- EMAIL US
- </td>
- </tr>
- </table>
- </td>
- <td style='font-size: 0; line-height: 0;' width='20'>
-
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </td>
- </tr>
- </table>
- </body>
- </html>
- ";
- $mail->send();
- echo 'Message has been sent';
- } catch (Exception $e) {
- echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement