<?php
function drk_send_mail($user, $subject, $body)
{
    $phpmailer = new PHPMailer\PHPMailer\PHPMailer();
    $phpmailer->isSMTP();
    $phpmailer->Host = 'smtp.mailtrap.io';
    $phpmailer->SMTPAuth = true;
    $phpmailer->Port = 2525;
    $phpmailer->Username = '258e6cd04ace12';
    $phpmailer->Password = '5c152a2be23d21';

    $phpmailer->setFrom('no-reply@darkey.com', 'Mailer');
    $phpmailer->addAddress($user->data->user_email, $user->data->user_nicename);

    $phpmailer->Subject = $subject;
    $phpmailer->Body = $body;

    $phpmailer->send();
}
