<?php

require "../PHPMailer/PHPMailerAutoload.php";

function smtpmailer($to, $from, $from_name, $subject, $body)
    {
        $mail = new PHPMailer();
        $mail->IsSMTP();
        $mail->SMTPAuth = true;

        $mail->SMTPSecure = 'ssl';
        $mail->Host = 'mail.deliveryexpressfast.com';
        $mail->Port = 465;
        $mail->Username = 'noreply@deliveryexpressfast.com';
        $mail->Password = 'adminemail123';

   //   $path = 'reseller.pdf';
   //   $mail->AddAttachment($path);

        $mail->IsHTML(true);
        $mail->From="noreply@deliveryexpressfast.com";
        $mail->FromName=$from_name;
        $mail->Sender=$from;
        $mail->AddReplyTo($from, $from_name);
        $mail->Subject = $subject;
        $mail->Body = $body;
        $mail->AddAddress($to);
        if(!$mail->Send())
        {
            $error ="Please try Later, Error Occured while Processing...";
            echo $error;
            return $error;
        }
        else
        {
            $error = "Thanks You !! Your email is sent.";
            echo $error;
            return $error;
        }
    }

    $to   = 'goodyblinkz@gmail.com';
    $from = 'noreply@deliveryexpressfast.com';
    $name = 'Delivery Express';
    $subj = 'Shipment Receipt';
    $msg = '
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
  </head>


  <div style="background: #f5f7f8;width: 100%;height: 100%; font-family: sans-serif; font-weight: 100;" class="be_container">

  <div style="background:#fff;max-width: 600px;margin: 0px auto;padding: 30px;"class="be_inner_container"> <div class="be_header">

  <div class="be_logo" style="float: left;"> <img src="log.png"> </div>

  <div class="be_user" style="float: right"> <p>Dear: Chika - Tracking ID: DGFHGKJDFGJD </p> </div>

  <div style="clear: both;"></div>

  <div class="be_bluebar" style="background: #d21919; padding: 20px; color: #fff;margin-top: 10px;">

  <h1>Shipment Receipt</h1>

  </div> </div>

  <div class="be_body" style="padding: 20px;">
  <p style="line-height: 25px;">




  <div class="container">


    <table class="table table-condensed" >


          <th>Package Name</th>
          <th>Shipment Date</th>
          <th>Email</th>
        </tr>

        <tr>
          <td>Product Name</td>
          <td>Shipment Date</td>
          <td>Reciever email</td>
        </tr>
        <tr>


         <tr>
          <th>Sender Address</th>
          <th>Sender Name</th>
          <th>Date</th>
        </tr>

          <td>sender address</td>
          <td>sender name</td>
          <td>shipment date</td>
        </tr>
        <tr>



        <tr>
               <th>Receiver Address</th>
          <th>Receiver Name</th>
          <th>Package Status</th>
        </tr>

          <td>receiver address</td>
          <td>reciever name</td>
          <td>status</td>
        </tr>



        <tr>
               <th>Location</th>
          <th>Tracking ID</th>

        </tr>

          <td>lagos</td>
          <td>dfhfghfhgfh</td>

        </tr>


      </tbody>
    </table>
  </div>

  </p> <div style="margin-top: 25px;">

   </div> </div>

   <div class="be_footer">
  <div style="border-bottom: 1px solid #ccc;"></div> <p> Please do not reply to this email. Emails sent to this address will not be answered.
  Copyright ©2020 deliveryexpress. </p> </div> </div> </div>';

    $error=smtpmailer($to,$from, $name ,$subj, $msg);

    ?>
