PHP code example of tsfcorp / email

1. Go to this page and download the library: Download tsfcorp/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/ */

    

tsfcorp / email example snippets


use TsfCorp\Email\Attachment;

$attachment = Attachment::path('/path/to/file.txt');
$attachment = Attachment::path('/path/to/file.txt', 'custom_name.txt');
$attachment = Attachment::disk('s3')->setPath('/path/to/file.txt');
$attachment = Attachment::disk('s3')->setPath('/path/to/file.txt', 'custom_name.txt');

composer 

'providers' => [
    // ...
    TsfCorp\Email\EmailServiceProvider::class,
];

php artisan email:install

use TsfCorp\Email\Email;
use TsfCorp\Email\Attachment;

$email = (new Email())
    ->to('[email protected]')
    ->cc('[email protected]')
    ->bcc('[email protected]')
    ->subject('Hi')
    ->body('Hi there!')
    ->addAttachment(Attachment::path('/path/to/file.txt'));

$email->enqueue();

$email->enqueue()->dispatch();