Shell File Manager

Current Path : /home/camscanae/public_html/support/send-mail/
Upload File :
Current File : /home/camscanae/public_html/support/send-mail/contact_us.php





<?php

use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

require 'PHPMailer/src/Exception.php';
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';

$mail = new PHPMailer;

if (isset($_POST['submit'])) {
    //get data from form
    $name = $_POST['name'];
    $email = $_POST['email'];
    $subject = $_POST['subject'];
    $message = $_POST['message'];
    // preparing mail content
    $messagecontent =

        "Good day  " . $name . "
<br>
Thank you for contacting us. You will receive a response as soon as possible. 
<br><br>
 " . $message;
    //Create an instance; passing `true` enables exceptions
    $mail = new PHPMailer(true);
    try {
        //Server settings
        //$mail->SMTPDebug = SMTP::DEBUG_SERVER;                      //Enable verbose debug output
        $mail->isSMTP();                                      // Set mailer to use SMTP
        $mail->Host = 'mail1.hostingplatform.com;smtp.camscan.ca';  // Specify main and backup SMTP servers
        $mail->SMTPAuth = true;                               // Enable SMTP authentication
        $mail->Username = '[email protected]';                 // SMTP username
        $mail->Password = '4$Wc8fYsJ2!%';                           // SMTP password
        $mail->SMTPSecure = 'tls';                            // Enable TLS encryption, `ssl` also accepted
        $mail->Port = 587;                                    // TCP port to connect to

        $mail->From = '[email protected]';
        $mail->FromName = 'CamScan FZCO Support';
        $mail->addAddress('[email protected]', 'Support');     // Add a recipient
        $mail->addReplyTo($email, $name);
        $mail->WordWrap = 50;                                 // Set word wrap to 50 characters




        //Content
        $mail->isHTML(true);                                  //Set email format to HTML
        $mail->Subject = $subject;
        $mail->Body    = $messagecontent;

        $mail->send();


        $alert = 'Message has been sent';
    } catch (Exception $e) {
        echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
    }
}

Shell File Manager Version 1.1, Coded By Shell
Email: [email protected]