akinsoftdev/sendinboxmail-laravel

SendInboxMail Mail Transport Driver for Laravel - A seamless integration for sending emails through SendInboxMail API

Installs: 3

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 0

pkg:composer/akinsoftdev/sendinboxmail-laravel

v1.0.2 2026-01-07 11:56 UTC

This package is auto-updated.

Last update: 2026-01-07 12:00:45 UTC


README

Latest Version on Packagist GitHub Tests Action Status Total Downloads License

A seamless Laravel mail transport driver for SendInboxMail email service. This package allows you to send emails through SendInboxMail API with full Laravel Mail integration.

Requirements

  • PHP 8.1 or higher
  • Laravel 10.x, 11.x, or 12.x

Installation

You can install the package via composer:

composer require akinsoftdev/sendinboxmail-laravel

The package will automatically register its service provider.

Configuration

1. Publish the Configuration File

php artisan vendor:publish --tag="sendinboxmail-config"

This will create a config/sendinboxmail.php file in your application.

2. Environment Variables

Add the following variables to your .env file:

SENDINBOXMAIL_URL=https://your-sendinboxmail-api-url.com/send
SENDINBOXMAIL_API_KEY=your-api-key
SENDINBOXMAIL_NEWS_ID=1
SENDINBOXMAIL_SENDER_ID=1
SENDINBOXMAIL_TIMEOUT=30
SENDINBOXMAIL_RETRY_TIMES=3

3. Configure Mail Driver

Add the SendInboxMail mailer to your config/mail.php file:

'mailers' => [
    // ... other mailers

    'sendinboxmail' => [
        'transport' => 'sendinboxmail',
    ],
],

4. Set as Default (Optional)

To use SendInboxMail as your default mailer, update your .env:

MAIL_MAILER=sendinboxmail

Usage

Using as Default Mailer

Once configured as default, all your emails will be sent through SendInboxMail:

use Illuminate\Support\Facades\Mail;
use App\Mail\WelcomeEmail;

Mail::to('user@example.com')->send(new WelcomeEmail());

Using Explicitly

You can also explicitly use the SendInboxMail mailer:

Mail::mailer('sendinboxmail')
    ->to('user@example.com')
    ->send(new WelcomeEmail());

Sending Raw Email

Mail::mailer('sendinboxmail')->raw('Hello World!', function ($message) {
    $message->to('user@example.com')
        ->subject('Test Email');
});

With Mailable Class

<?php

namespace App\Mail;

use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Mail\Mailables\Content;
use Illuminate\Mail\Mailables\Envelope;
use Illuminate\Queue\SerializesModels;

class WelcomeEmail extends Mailable
{
    use Queueable, SerializesModels;

    public function envelope(): Envelope
    {
        return new Envelope(
            subject: 'Welcome to Our Platform',
        );
    }

    public function content(): Content
    {
        return new Content(
            view: 'emails.welcome',
        );
    }
}

Inline Attachments

The package supports inline attachments (embedded images):

<img src="{{ $message->embed(public_path('images/logo.png')) }}" alt="Logo">

Configuration Options

Option Description Default
url SendInboxMail API endpoint URL https://notify.sendinboxmail.com/manage/send.php
apikey Your SendInboxMail API key -
news_id Campaign/News identifier -
sender_id Sender profile identifier -
timeout Request timeout in seconds 30
retry_times Number of retry attempts 3

Error Handling

The package throws SendInboxMailException for any API errors:

use Akinsoft\SendInboxMail\Exceptions\SendInboxMailException;

try {
    Mail::mailer('sendinboxmail')->to('user@example.com')->send(new WelcomeEmail());
} catch (SendInboxMailException $e) {
    // Handle the exception
    Log::error('SendInboxMail Error: ' . $e->getMessage());
}

Testing

composer test

Code Style

This package uses Laravel Pint for code styling:

composer format

Static Analysis

Run PHPStan for static analysis:

composer analyse

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

Security Vulnerabilities

If you discover a security vulnerability, please send an email to programlama@akinsoft.com.tr. All security vulnerabilities will be promptly addressed.

Credits

License

The MIT License (MIT). Please see License File for more information.