mrpck/email

The Email Class Library is a high level wrapper around the SmtpClient.

1.0.3 2021-05-03 10:18 UTC

This package is auto-updated.

Last update: 2024-10-29 06:06:13 UTC


README

The Email Class Library is a high level wrapper around the SmtpClient.

Install

Copy the files under src/ to your program

OR

composer require mrpck/email 1.0.0

Usage

use Mrpck\Email\Email;

$mail = (new Email())
    ->from('hello@example.com')
    ->to('you@example.com')
    ->cc('cc@example.com')
    //->bcc('bcc@example.com')
    //->replyTo('fabien@example.com')
    //->priority(Email::PRIORITY_HIGH)
    ->subject('Time for PHP Mailer!')
	//->attach(file_get_contents('test.pdf'), 'test.pdf')
	//->text('Sending emails is fun again!')
    ->html('<p>See Twig integration for better HTML integration!</p>');

if(!$mail->Send()) {
	echo 'Message could not be sent.';
	echo 'Mailer Error: ' . $mail->ErrorInfo;
} else {
	echo 'Message has been sent';
}