<!DOCTYPE html>
<html lang="en">
    <head>
        <title>Fastcare Logistics</title>
        <meta charset='utf-8'>
        <meta name='viewport' content='width=device-width initial-scale=1'>
        <meta http-equiv='X-ua-compatible' content='ie=edge'>
        <link rel="stylesheet" href="css/bootstrap.min.css">
        <link rel="stylesheet" href="css/main.css">
        <link rel="stylesheet" href="css/reg.css">
        <link rel="stylesheet" href="css/animate.css">
        <link rel="stylesheet" media="screen and (max-width:947px)" type="text/css" href="css/medium.css">
      <link rel="stylesheet" media="screen and (min-width:801px) and (max-width:946px)" type="text/css" href="css/smaller.css">
      <link rel="stylesheet" media="screen and (min-width:547px) and (max-width:800px)" type="text/css" href="css/small.css">
      <link rel="stylesheet" media='screen and (max-width:546px)' type="text/css" href="css/xtrasmall.css">    
        <link href='bootstrap/css/bootstrap.min.css' rel='stylesheet'>  
    <style>
        .myform{
            border:none;
            margin:3em;
            padding:20px;
            background-color:#f0f0f5;
            padding:10px;
        }
    </style>
    
</head>
<body>
    
  <nav class="navbar navbar-expand-lg navbar-dark bg-dark">
        <a class="navbar-brand" href="#">Fastcare Logistics</a>
        <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarTogglerDemo02" aria-controls="navbarTogglerDemo02" aria-expanded="false" aria-label="Toggle navigation">
          <span class="navbar-toggler-icon"></span>
        </button>
    
        <div class="collapse navbar-collapse" id="navbarTogglerDemo02">
          <ul class="navbar-nav mr-auto mt-2 mt-lg-0">
            <li class="nav-item">
              <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
            </li>
          </ul>
          <ul class="nav navbar-nav">
              
          <li class="nav-item">
              <a class="nav-link " href="form.html">Mailer</a>
            </li>
          <li class="nav-item">
              <a class="nav-link " href="register.php">Add Admin</a>
            </li>
            <li class="nav-item active">
              <a class="nav-link" href="#">Login</a>
            </li>
          </ul>
        </div>
      </nav>
    <div class='container'>
        <div class='row'>
            <div class='col-xs-4 col-sm-4 col-md-8 offset-2'>
 
    <?php
    # Include the Autoloader (see "Libraries" for install instructions)
    
    use Mailgun\Mailgun;
if(isset($_POST["submit"])){
    require "vendor/autoload.php";

# Instantiate the client.
$mgClient = new Mailgun('6dc6fe16ca9fe7338347f181ff7445ca-7bce17e5-56500c80');
//$domain = "fastcarelogistics.com";

# Make the call to the client.
$result = $mgClient->sendMessage("gbcglobaltransport.com",
          array('from'    => 'customercare@gbcglobaltransport.com ',
                'to'      => '<'. $_POST['email']  .'>',
                'subject' => $_POST['title'],
                'text'    =>  $_POST['message'],
                 ));

}           

if($result){
      echo '<div class="alert alert-success text-center"> Message Success </div>';
}
    ?>

             <div class='myform'>
                <form action="#"  method='POST' class='form-group'>
                    <input type="text" class='form-control' name='title' placeholder="Title">
                    <br>
                    <input type="text" class='form-control' name='email' placeholder="Recipent-Email">
                     <br>
                    <textarea name="message" id="" cols="45" rows="10" placeholder="wirte " class='form-control'>
                 </textarea>
                 <br>
                   <button type='submit' name='submit' class='btn btn-primary btn-block'>submit</button>
                </form>
            </div>


            </div>
        </div>
    </div>

    <div class="footer bg-dark">
            <div class="container">
              <span class="">jglobal delivery</span>
            </div>
          </div>
    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
    <script src='bootstrap/js/bootstrap.js'></script>
</body>

</html>