 <?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 = "ssl";
        $mail->Host = "demo.71mail.online";
        $mail->Port = 465;
        $mail->AddAddress($email);
        $mail->Username = "noreply@demo.71mail.online";
        $mail->Password = "Loveable123@";
        $mail->SetFrom('noreply@demo.71mail.online', 'Demo 71Mail');
        $mail->AddReplyTo("noreply@demo.71mail.online", "Demo 71Mail");
        $mail->Subject = $subject;
        $mail->MsgHTML($messag);
        $mail->Send();
    }
//-----------EDIT THIS AREA TO SEND MAIL-----------//



    function otp($to, $msg) {
        //twillio
        $sid = "ACb12d9560cbf792860052fcb0e5fc85c8"; // Your Account SID from www.twilio.com/console
        $token = "2942427e444ab0ec35828f75129dea91"; // Your Auth Token from www.twilio.com/console
        $client = new Twilio\Rest\Client($sid, $token);
         try { $message = $client->messages->create(
                '+' . $to, array(
            'from' => 'AUDACITYADS', // 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>";
  }

}

    ?>