This library has the function to send email using the phpmailer library. Making this action uncomplicated is essential for any system.
To install the library, run the following command:
composer require macielsalzano/notification
To make use of the library, just require composer autoload, invoke the class and call the method:
<?php
require __DIR__ . '/vendor/autoload.php';
USE Notification\Email;
$email = new Email(2, "mail.host.com", "[email protected]", "your-pass", "smtp secure (tls/ssl)", "port (587)",
"[email protected]", "From Name");
$email->sendEmail("SUbject", "Content", "[email protected]", "Replay Name", "[email protected]", "Address Name");
Note that the entire configuration of sending the email is using the magic constructor method! Once the constructor method is invoked within your application, your system will be able to perform the triggers.
- Gustavo Web - Developer of this library and tutor of the Composer in Practice course!
- Robson V. Leite - CEO and Founder UpInside Treinamentos
- UpInside Treinamentos - Official website of your digital programming and marketing school
- phpMailer - Lib to send E-mail
MIT
Another UpInside Treinamentos course, make good use of it!