dilongfa / smtpmailer

A simple, secure SMTP Client library written in PHP, only supports TLS, SSL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SMTPMailer

A simple, lightweight and secure SMTP Client library written in PHP, only supports TLS, SSL

Install

Via Composer

$ composer require dilongfa/smtpmailer

Usage

<?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";
}

Examples

Click here

Security

If you discover any security related issues, please email dilongfa@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.

About

A simple, secure SMTP Client library written in PHP, only supports TLS, SSL


Languages

Language:PHP 100.0%