Comproser ile
composer require swiftmailer/swiftmailer
şeklinde kurabilirsiniz.
gmail üzerinden mail göndermek isterseniz
<?php
$pEmailGmail = 'kullaniciadi@gmail.com';
$pPasswordGmail = 'sifreniz';
$pFromName = 'tasarimrehberi.net'; //gozukecek mail adresiş$pTo = 'gidecekmailadresi@tasarimrehberi.net'; // gonderilecek mail
$pSubjetc = "tasarimrehberi.net deneme"; // konu
$pBody = '<html><body><p>Tasarım Rehberi deneme</p></html></body>'; //body html$transport = Swift_SmtpTransport::newInstance('smtp.googlemail.com', 465, 'ssl')
->setUsername($pEmailGmail)
->setPassword($pPasswordGmail);$mMailer = Swift_Mailer::newInstance($transport);
$mEmail = Swift_Message::newInstance();
$mEmail->setSubject($pSubjetc);
$mEmail->setTo($pTo);
$mEmail->setFrom(array($pEmailGmail => $pFromName));
$mEmail->setBody($pBody, 'text/html'); //body htmlif($mMailer->send($mEmail) == 1){
echo 'Mail Gonderildi';
}
else {
echo 'Mail Gitmedi';
}
?>{/code]