PHP code example of rhysnhall / laravel-socketlabs-driver

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

    

rhysnhall / laravel-socketlabs-driver example snippets


composer 

'socketlabs' => [
  'key' => env('SOCKET_LABS_API_KEY'),
  'id' => env('SOCKET_LABS_SERVER_ID')
]

'providers' => [
  ...
  Rhysnhall\LaravelSocketLabsDriver\SocketLabsServiceProvider::class
]

'mailers' => [
  ...
  'socketlabs' => [
    'transport' => 'socketlabs'
  ]
]

'mailers' => [
  ...
  'socketlabs' => [
    'transport' => 'socketlabs',
    'retries' => 2,
    'timeout' => 120,
    'proxy_url' => 'https://example'
  ]
]



return [
  'retries' => 2,
  'timeout' => 120,
  'proxy_url' => 'https://example'
];

class Test extends Mailable {
  public function build()
  {
      return $this->from('[email protected]')
        ->view('emails.html.test')
        ->text('emails.plain.test')
        ->attach(storage_path('test_image.png'));
  }
}


Mail::to('[email protected]')->send(new \App\Mail\Test);

SOCKET_LABS_API_KEY={your_key}
SOCKET_LABS_SERVER_ID={server_id}