https://github.com/PHPMailer/PHPMailer


@SSHussein;

<?php
require 'vendor/autoload.php';


use PHPMailerPHPMailerPHPMailer;
use PHPMailerPHPMailerSMTP;
use PHPMailerPHPMailerException;


$mail = new PHPMailer(true);

try {

$mail->SMTPDebug = SMTP::DEBUG_SERVER;
    $mail->isSMTP();
    $mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
            'verify_peer_name' => false,
            'allow_self_signed' => true
        )
);
    $mail->Host         = 'localhost';                  
    $mail->SMTPAuth     = true;                                
    $mail->Mailer       = "smtp";
    $mail->Priority     = 1;
    $mail->SMTPSecure   = 'ssl';
    $mail->Username     = 'kulanıcıadi@sitename.com';                    
    $mail->Password     = 'sifreniz';                            
    $mail->SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS;        
    $mail->Port         = 587;                                  
    $mail->SMTPAutoTLS  = true;

    //Recipients
    $mail->setFrom('kulanıcıadi@sitename.com ', 'Mail Görünen Ad');
    $mail->addAddress('aliciMail@gmail.com', 'Serdar Yapma Ben Yapancı Değilim');
  
    //Content
    $mail->isHTML(true);                              
    $mail->Subject = 'Here is the subject';
    $mail->Body    = 'This is the HTML message body <b>in bold!</b>';
    $mail->AltBody = 'This is the body in plain text for non-HTML mail clients';

    $mail->send();
    echo 'Message has been sent';
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
?>

Plesk Panel Posta Ayarlarından aşağıdaki bölümü aktif edin!