<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;

require_once __DIR__ . '/PHPMailer/src/Exception.php';
require_once __DIR__ . '/PHPMailer/src/PHPMailer.php';
require_once __DIR__ . '/PHPMailer/src/SMTP.php';

class Email {
    public static function enviar($para, $assunto, $mensagemHtml) {
        $mail = new PHPMailer(true);
        try {
            $mail->isSMTP();
            $mail->Host = 'smtp.seudominio.com';
            $mail->SMTPAuth = true;
            $mail->Username = 'usuario@seudominio.com';
            $mail->Password = 'sua_senha';
            $mail->SMTPSecure = 'tls';
            $mail->Port = 587;

            $mail->setFrom('nao-responder@seudominio.com', 'Sistema SOV');
            $mail->addAddress($para);

            $mail->isHTML(true);
            $mail->Subject = $assunto;
            $mail->Body    = $mensagemHtml;

            return $mail->send();
        } catch (Exception $e) {
            return false;
        }
    }
}
?>