<?php
// ==========================EMAIL VERIFICATION====================================
    try{
        $to = $_GET['my_email'];
        $from = "jrcwaterrefillingstation@gmail.com";
        $subject = "JRC WATER REFILLING STATION";
        
        $message = 'Good Day! This is JRC WATER REFILLING STATION. Here is your verification code: '.$_GET['verif'].',<br>';
        
        
        // Always set content-type when sending HTML email
        $headers = "";
        $headers .= 'From: ' . $from . "\r\n";
        $headers .= "MIME-Version: 1.0" . "\r\n";
        $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
        
        if(mail($to,$subject,$message,$headers)){
            header("Location: http://jrc-refill.epizy.com/verify_number.php?my_email=" . $_GET['my_email'] . "&my_number=" . $_GET['phone']);
        }
        else{
            header("Location: http://jrc-refill.epizy.com/register.php");
        }
    }
    catch (Exception $e) {
       header("Location: http://jrc-refill.epizy.com/register.php");
    }

?>