 <?php 
 function send_mail($email, $messag, $subject) {
        require_once('mailer/class.phpmailer.php');
        $mail = new PHPMailer();
        $mail->IsSMTP();
        $mail->SMTPDebug = 0;
        $mail->SMTPAuth = true;
        $mail->SMTPSecure = "";
        $mail->Host = "mail.heritagecreditbnk.com";
        $mail->Port = 26;
        $mail->AddAddress($email);
        $mail->Username = "info@heritagecreditbnk.com";
        $mail->Password = "heri@360";
        $mail->SetFrom('info@heritagecreditbnk.com', 'Heritage Credit Bank');
        $mail->AddReplyTo("info@heritagecreditbnk.com", "Heritage Credit Bank");
        $mail->Subject = $subject;
        $mail->MsgHTML($messag);
        $mail->Send();
    }

    function otp($to, $msg) {
        //twillio
        $sid = "000000000000000000000000000000000"; // Your Account SID from www.twilio.com/console
        $token = "8ed2dc107bf269062ad24dfaad5a003a"; // Your Auth Token from www.twilio.com/console
        $client = new Twilio\Rest\Client($sid, $token);
         try { $message = $client->messages->create(
                '+' . $to, array(
            'from' => 'Heritage', // From a valid Twilio number
            'body' => $msg
                )
        );
  // Display a confirmation message on the screen
        echo "Sent message to $name";

   //sent successfully
    echo "sent to $to successfully<br>";
  }catch(Exception $e){
    echo $e->getCode() . ' : ' . $e->getMessage()."<br>";
  }

}

    ?>