A simple, lightweight and secure SMTP Client library written in PHP, only supports TLS, SSL
Via Composer
$ composer require dilongfa/smtpmailer
<?php
$mail = new SMTPMailer\Mailer('smtp.example.com', 587, 'tls');
$mail->setAuth('username@example.com', 'password');
$mail->setFrom('sender@example.com', 'Sender Name');
$mail->setTo('recipient@example.com', 'Recipient Name');
$mail->setSubject('Subject...');
$mail->setBody('Body...');
if ($mail->send()) {
echo "Sent successfully";
} else {
echo "Sent failed";
}
If you discover any security related issues, please email dilongfa@gmail.com instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.