PHP code example of mailjet / laravel-mailjet
1. Go to this page and download the library: Download mailjet/laravel-mailjet 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/ */
mailjet / laravel-mailjet example snippets
'providers' => [
...
Mailjet\LaravelMailjet\MailjetServiceProvider::class,
...
]
use Mailjet\LaravelMailjet\MailjetServiceProvider;
return [
App\Providers\AppServiceProvider::class,
MailjetServiceProvider::class,
];
'aliases' => [
...
'Mailjet' => Mailjet\LaravelMailjet\Facades\Mailjet::class,
...
]
'mailjet' => [
'key' => env('MAILJET_APIKEY'),
'secret' => env('MAILJET_APISECRET'),
'sandbox' => filter_var(env('MAILJET_SANDBOX', false), FILTER_VALIDATE_BOOLEAN),
]
MAILJET_APIKEY=YOUR_APIKEY
MAILJET_APISECRET=YOUR_APISECRET
MAIL_FROM_ADDRESS=YOUR_EMAIL_FROM_ADDRESS
MAIL_FROM_NAME=YOU_FROM_NAME
# Optional: Enable sandbox mode for testing (emails won't be actually sent)
MAILJET_SANDBOX=false
'providers' => [
...
\Mailjet\LaravelMailjet\Providers\ContactsServiceProvider::class,
...
]
public function handle(ContactsV4Service $contactsV4Service)
{
$response = $contactsV4Service->delete(351406781);
...
}