sharasolns / sdp-email
An SDP Email API transport for Laravel Mail.
Requires
- php: ^8.2
- illuminate/mail: ^11.0|^12.0|^13.0
- illuminate/support: ^11.0|^12.0|^13.0
- symfony/http-client: ^7.0|^8.0
Requires (Dev)
- orchestra/testbench: ^9.0|^10.0|^11.0
- phpunit/phpunit: ^11.0|^12.0
README
Send Laravel mailables through the SDP Email HTTP API. The package adds an
sdp Laravel mail transport and is auto-discovered after installation.
Install
composer require sharasolns/sdp-email
In the application's .env file, change the existing MAIL_MAILER value to
sdp:
MAIL_MAILER=sdp
Then add your SDP Email API key:
SDP_EMAIL_KEY=sdp_your_api_key
Check the existing MAIL_FROM_ADDRESS value and make sure it uses a domain
that is enabled for outbound sending in SDP Email. You do not need to add
another sender setting if it is already correct.
Laravel discovers the package automatically, so no configuration files need
to be changed. SDP_EMAIL_ENDPOINT and SDP_EMAIL_TIMEOUT are optional.
The sending domain must be registered in SDP Email, enabled for outbound sending, and allowed by the API key.
Use Laravel Mail normally:
use Illuminate\Support\Facades\Mail; Mail::raw('Sent through SDP Email.', function ($message) { $message->to('person@example.net')->subject('Hello'); });
Mailables, queued mail, HTML and text bodies, CC, BCC, reply-to addresses, custom headers, and file attachments are supported.
Development
composer install
composer test