tourze/smtp-mailer-bundle
A lightweight Symfony bundle for SMTP email delivery. It wires SMTP mailer transport configuration into your app, letting you set host, port, and credentials and send mail through Symfony's mailer services with minimal setup. Useful for straightforward SMTP integration.
At 0.0.x this package is pre-1.0 and the 0.0.2 release carries no changelog beyond a compare link, so treat the whole API surface as provisional until you've read the diff yourself.
composer require tourze/smtp-mailer-bundle:0.0.2 — do not use a ^0.0 constraint, since 0.0.x bumps may change signatures without notice.composer.json (to see what it requires and how it autoloads), then the bundle/extension class and its Configuration definition. In a Symfony-style bundle the extension class is where the real defaults live; that is the authoritative behaviour, not the README.ServiceProvider or extra.laravel.providers entry is present. If not, you'll be wiring it manually (see Gotchas).smtp://user:[email protected]:587, send a Mailable through Mail::to(...)->send(...), and verify delivery before touching anything else. The value of this package is concentrated almost entirely in transport/config wiring — prove that path works end to end first.If that minimal path doesn't work within an hour, stop and evaluate whether Laravel's built-in Symfony Mailer transports already cover your need (they usually do).
Configuration via DSN, not scattered options. Keep credentials in config/mail.php fed from .env, and express the transport as a single DSN string. This is the pattern the underlying SMTP transport expects and it makes staging/production swaps trivial:
'smtp_custom' => [
'transport' => 'smtp',
'host' => env('MAIL_HOST'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
],
Multiple named mailers. If the package resolves a transport per mailer name, declare two or three mailers (transactional, bulk/ESP, internal relay) and select at send time with Mail::mailer('bulk')->to(...). This is the cleanest way to route without spreading conditionals through your app.
Queued mailables from day one. SMTP handshakes are the slowest part of a request. Make every non-trivial mailable ShouldQueue and set a dedicated mail queue so slow SMTP retries don't starve your job workers.
Test seam: Mail::fake() locally, Mailpit/MailHog in CI. Fake for assertions in feature tests; a real SMTP sink for integration tests so encoding, TLS, and auth problems surface before production.
Wrap it behind a small adapter. Because 0.0.x is volatile, isolate usage in one class (a MailDispatcher or similar) so a future version bump touches one file rather than thirty call sites.
Verify with a command. Add an artisan command or php artisan tinker snippet that sends a bare message. Keeping that reproducible saves hours when config drifts.
0.0.2 changelog is empty. Before upgrading, run git diff 0.0.1..0.0.2 (or browse the compare URL) against vendor/. An undocumented bump in a 0.0.x package is the highest-risk kind.php artisan about / the vendor list doesn't show it, register the service provider manually in config/app.php (or bootstrap/providers.php on Laravel 11+) and re-run php artisan config:clear.php artisan config:clear (and queue:restart for workers). A "credentials wrong" error is frequently a cached config.587 is STARTTLS (tls), 465 is implicit TLS (ssl), 25 is generally blocked by cloud providers. Getting this wrong produces timeouts that look like network failures.MAIL_FROM_ADDRESS. Some SMTP relays reject mail without a matching envelope sender even when the From header is set.openssl s_client -connect host:587 -starttls smtp) to separate network/TLS/auth problems from Laravel wiring problems. Laravel's transport exceptions often hide the underlying SMTP response code in getPrevious().Mailer/TransportInterface implementation in a service provider — that keeps your code upgrade-safe when 0.0.3 lands.smtp mailer config. Adopt it only where it demonstrably saves you work, and have a two-line rollback to stock config ready.How can I help you explore Laravel packages today?