Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Mail Laravel Package

nette/mail

Nette Mail is a simple, flexible PHP library for sending emails. It supports SMTP, sendmail, and PHP mail, with a clean API for building messages, attachments, HTML bodies, and multiple recipients.

View on GitHub
Deep Wiki
Context7

Nette Mail is a lightweight PHP library for composing and sending emails. Its clean object-oriented API builds messages with HTML and plain-text alternatives, attachments, inline images, and multiple recipients, then delivers them through a configurable mailer.

It ships with SMTP, sendmail, and PHP mail() transports, supports SSL/TLS and authentication, and integrates smoothly with Latte templates.

  • Fluent Message API with attachments, inline images, and multipart bodies
  • SMTP mailer with SSL/TLS, authentication, and persistent connections
  • Sendmail and PHP mail() fallbacks
  • DKIM message signing
  • Framework-agnostic, works standalone or with Nette
Frequently asked questions about Mail
Can I use nette/mail in a Laravel application?
Yes, technically you can use its plain PHP classes and wire them yourself in a Laravel service provider. It is not a drop-in replacement for Laravel's Mail facade, and the Nette DI extension is not useful in Laravel. Expect to build your own queue integration, view rendering, and test fakes.
How does nette/mail compare to Laravel Mail and Symfony Mailer?
Nette Mail overlaps about 90% with Laravel's existing mail stack. Laravel already gives you Blade mailables, queues, Mail::fake(), events, localization, and Markdown mailables through Symfony Mailer. Nette Mail offers its own message builder, SMTP and sendmail transports, DKIM signing, and CSS inlining, but adopting it means replacing Laravel's layer rather than extending it.
What are the main risks of adopting nette/mail in Laravel?
License verification is the top blocker because tooling reports NOASSERTION instead of a confirmed BSD-3-Clause grant. You also lose Laravel-native queueing, testing fakes, events, and localization, so those become your code. The SMTP transport is synchronous and blocking, which is a production risk without a queue worker.
Does nette/mail support Laravel queues and ShouldQueue?
No, nette/mail has no native Laravel queue integration. Its SmtpMailer is a blocking socket implementation, so sending without a queue worker in front of it can add latency and availability risk. You would need to write your own queue job wrapper if you replace Laravel Mail.
Can nette/mail render Blade templates or Markdown mailables?
No, nette/mail does not include a Blade or Blade-component view layer. It has an HtmlComposer HTML preprocessing pipeline and CssInliner, but you would need to render Blade yourself and pass the HTML into nette/mail. Laravel's Markdown mailables and localization helpers are not part of nette/mail.
What Laravel or PHP version do I need for nette/mail?
Version 4.1.0 raised the PHP floor to 8.2, so you need PHP 8.2 or newer for the latest line. There is no Laravel-specific version support because nette/mail is framework-agnostic PHP. Pin to ^4.1 and budget for minor-version re-tests because v4.0 already broke constructor signatures.
How do I install and configure nette/mail in Laravel?
Install it with Composer, then ignore the Nette DI MailExtension and register the mailer classes in a Laravel service provider. Configuration is manual: you create the SMTP, sendmail, or mail transport and pass credentials yourself. There is no config/mail.php-style integration or per-mail transport selection without custom code.
Does nette/mail handle DKIM signing and CSS inlining?
Yes, nette/mail includes DKIM signing covering Subject and To, plus CssInliner for Outlook-friendly attribute generation. It also has HtmlComposer for standalone HTML preprocessing and an Interceptor for safe local or preview sends. These are the areas where it is ahead of the default Laravel path, but you own the DKIM private key and passphrase lifecycle.
What testing support does nette/mail offer compared to Mail::fake()?
Nette Mail does not provide an equivalent to Laravel's Mail::fake() assertions or mail events. If you cut over, you need to build your own fake or test double around your internal mailer abstraction. The Interceptor can help with preview and safe local sends, but it is not a test assertion layer.
Is nette/mail a good alternative to Laravel Mail for production email?
It can be a viable sidecar for specific high-value paths, especially if you need DKIM signing or CSS inlining, but it is not a clean Symfony Mailer transport bridge. A full cutover means owning queueing, retries, bounces, observability, view rendering, and testing. Verify the license first, and consider whether your provider already handles DKIM and inlining.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings
coleus/apps
seampact/laravel
emmyconceptng/laravel-ng-postcode
jjsquady/round-robin
skyraptor/chatter
edlugz/sasapay
abbasudo/artisan-route