<?php
require_once 'PHPMailer/src/PHPMailer.php';
require_once 'PHPMailer/src/Exception.php';
require_once 'PHPMailer/src/SMTP.php';
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\SMTP;
use PHPMailer\PHPMailer\Exception;
function shreeMailer($first_name,$sec_name,$email1,$email2,$body){
    $vpt_email = "admin@onlineinstantloan.in";  
    $subject = "New Contact Form Query";
     
    $mail = new PHPMailer();

    $mail->IsSMTP();                       // telling the class to use SMTP

    $mail->SMTPDebug = 0;                  
    // 0 = no output, 1 = errors and messages, 2 = messages only.

    $mail->SMTPAuth = true;                           // enable SMTP authentication 
    $mail->SMTPSecure = "tls";              // sets the prefix to the server
    $mail->Host = "smtp.onlineinstantloan.in";        // SMTP server host
    $mail->Port = 587;                     // set the SMTP port for the email 

    $mail->Username = $vpt_email;  // username
    $mail->Password = "Services@2095";      // password


    $mail->SetFrom ($vpt_email, 'Online Instant Loan');
    $mail->AddReplyTo($vpt_email, 'Online Instant Loan');
   
    $mail->Subject = $subject;
    $mail->ContentType = 'text/plain'; 
    $mail->IsHTML(true);
    $mail->MsgHTML($body);

    // you may also use $mail->Body = file_get_contents('your_mail_template.html');

    $mail->AddAddress ($email1, $first_name); 
    $mail->AddAddress ($email2, $sec_name);     
    // you may also use this format $mail->AddAddress ($recipient);

    if(!$mail->Send()) 
    {
            $error_message = "Mailer Error: " . $mail->ErrorInfo;
    } else 
    {
            return "success";
    }
}
?>