<?php

function sendMail($mail, $data){

    try {
        //Recipients
        $mail->setFrom(SENDER_MAIL, SENDER_NAME);                           // gönderen
        $mail->addAddress($data['email'], $data['name']);       // Alıcı
        $mail->addReplyTo(SENDER_MAIL, SENDER_NAME);                        // yanıtlanacak adres
        //Content
        $mail->isHTML(true);
        $mail->Subject = $data['subject'];
        $mail->Body    = $data['body'];
        $mail->CharSet = 'UTF-8';
        $mail->send();
        return true;
    } catch (Exception $e) {
        return false;
        /*
        echo 'Message could not be sent.';
        echo 'Mailer Error: ' . $mail->ErrorInfo;
        */
    }

}