<link rel="stylesheet" href="../css/sweet-alert.css" /> 

<?php 
include("../connection.php");
include("../user.php");
$user=$_SESSION['user'];
$cur_date=date('Y-m-d H:i:s');

	$username=$_REQUEST['username'];
	$password=$_REQUEST['password'];
	$host=$_REQUEST['host'];
	$smtp=$_REQUEST['smtp'];
	$port=$_REQUEST['port'];
	$ishtml=$_REQUEST['ishtml'];
	
	$up_sql=mysqli_query($con,"update mail_config set status='1'");
	
		$confg=mysqli_query($con,"INSERT INTO mail_config(username,password, host, smtpsecure, port, ishtml, status, created_on) VALUES ('$username','$password','$host','$smtp','$port','$ishtml','0','$cur_date')");
		
if($confg)
	{
	?>
	<script>
	
	
    setTimeout(function() {
        swal({
            title: "Successfully",
            text: "Mail Created!",
            type: "success"
        }, function() {
        window.location = "mail_master.php";
        });
    }, 100);
</script>  
    <?php
	}	
	else
	{
	?>
	<script>
    setTimeout(function() {
        swal({
            title: "Not",
            text: "Mail Created!",
            type: "error"
        }, function() {
         window.location = "mail_master.php";
        });
    }, 100);
</script> 	  
	<?Php
	}	
?>

  <script src="../js/sweet-alert.js"></script>

