- 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.