<?php
function connect(){
$dbc = mysqli_connect("localhost", "sshuujin_bowenapp", "80622BOWen") or die('No server');
	mysqli_select_db($dbc, "sshuujin_bowensshub_v2") or die('No db');
	return $dbc;

}

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 = 'sshubapp.com';
        $mail->Port = 465;  
        $mail->Username = 'bowenapp@sshubapp.com';
        $mail->Password = '80622FUNbi';   
   
   //   $path = 'reseller.pdf';
   //   $mail->AddAttachment($path);
   
        $mail->IsHTML(true);
        $mail->From="bowenapp@sshubapp.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... If Error Persists, Please Contact Directorate of Digital Services";
            return $error; 
        }
        else 
        {
            $error = "Thanks You !! Memo Sent Successfully";  
            return $error;
        }
    }




?>