PHP code example of mrpck / email

1. Go to this page and download the library: Download mrpck/email library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mrpck / email example snippets


use Mrpck\Email\Email;

$mail = (new Email())
    ->from('[email protected]')
    ->to('[email protected]')
    ->cc('[email protected]')
    //->bcc('[email protected]')
    //->replyTo('[email protected]')
    //->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';
}