PHP code example of jackwiy / sendcloud

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

    

jackwiy / sendcloud example snippets


'providers' => [
   // 添加这行
    JackWiy\Mail\SendCloudServiceProvider::class,
];

Mail::send('emails.welcome', $data, function ($message) {
    $message->from('[email protected]', 'Laravel');

    $message->to('[email protected]')->cc('[email protected]');
});

// 模板变量
$bind_data = ['url' => 'http://jackwiy.me'];
$template = new SendCloudTemplate('模板名', $bind_data);

Mail::raw($template, function ($message) {
    $message->from('[email protected]', 'Laravel');

    $message->to('[email protected]')->cc('[email protected]');
});