<?php
$ar['mail_api_url']='https://cpapp.ekbis.blog/api/v2/';
$ar['mail_name']='Ekbis';
$ar['mail_username']='cs@ekbis.blog';
$ar['mail_password']=')pU)vrOR2p~Z3*@o';
/*
s1:NyhUex9[
include "db.php";
$to="ainunkarimah85@gmail.com";
$name="afza";
$subject="Tes kirim Email";
$content="Tes kirim Email dr server";

echo sendMail($to,$name,$subject,$content);
*/
function sendMail($to,$name,$subject,$content){
  global $db,$ar;

  include '/home/u1731472/public_html/src/phpmailer/class.phpmailer.php';
  $mail = new PHPMailer;
  $mail->isSMTP();                     // Set mailer to use SMTP
  $mail->Host = 'mail.ekbis.blog';  // Specify main and backup SMTP servers
  $mail->SMTPAuth = true;              // Enable SMTP authentication
  $mail->Username = $ar['mail_username'];  // SMTP username
  $mail->Password = $ar['mail_password'];      // SMTP password
  //$mail->SMTPSecure = 'ssl';         // Enable encryption, 'ssl' also accepted
  $mail->Port = 465;
  $mail->From = $ar['mail_username'];
  $mail->FromName = $ar['mail_name'];
  $mail->addAddress($to,$name);        // Name is optional
  $mail->addReplyTo($ar['mail_username'], $ar['mail_name']);
  $mail->isHTML(true);                 // Set email format to HTML
  $mail->Subject = $subject;
  $mail->Body    = $content;
  
  if(!$mail->send()) {
    $ret['message']= $mail->ErrorInfo; 
    $ret['code']=9;
  } else {
    $ret['code']=1;
    $ret['message'] = "Email Success";
  }
  return $ret;
}


?>
/home/u1731472/public_html/
sub/cpapp_ekbis/api/v2/inc.mail.php