nette/mail
Lightweight PHP mailer from the Nette framework: compose and send emails with SMTP support, MIME messages, attachments, HTML/text bodies, and headers. Sensible defaults, easy integration, and good testability for apps and services.
To/Cc/Bcc (plus read-receipt headers) to one fixed address, preserves the originals in X-Original-* headers, and optionally adds a subject prefix. No more sending test mail to real customers by accident. Wire it via DI with mail.redirect: dev@example.com and it slots in automatically.Bridges/MailTracy/MailPanel subscribes to Interceptor::$onSent and lists each sent message (From / To+Cc+Bcc / Subject / Status) right in the Tracy Bar. Auto-registers in debug mode whenever the Interceptor is active; opt in or out explicitly with mail: debugger: true|false.HtmlComposer – a standalone HTML pre-processing pipeline you can drive directly: opt in to inlineCss() (accumulates stylesheets across calls), embedImages($basePath), and let it handle <title> to subject extraction and plain-text alternative generation. Message::setHtmlBody() keeps working as a BC-friendly facade.data: URIs. A >500 kB base64 payload used to exhaust PCRE's backtrack limit and abort the whole send; the regex is now backtracking-free (#79)src="…" or url('…') contains spaces, like "holiday photos/beach.jpg" (#97)screenshot (1).png naming no longer silently breaks (#89)Subject and To headers, closing a deliverability gap at Gmail, Outlook, and other strict providers (#99)::marker, :hover, :checked no longer break inliningurl() quote combinations that previously tripped the parserThis release introduces CssInliner – a brand-new component that brings CSS-to-inline-style conversion directly into Nette Mail. The minimum PHP version has been raised to 8.2, and static analysis is now a mandatory part of the build pipeline.
Minimum PHP version raised from 8.0 to 8.2 – time to upgrade if you haven't already
Improved PHPDoc types and descriptions for better IDE support and static analysis accuracy
CssInliner – converts <style> rules into inline style attributes, making your HTML emails render consistently across email clients. Features a single-regex tokenizer, full CSS nesting support, Dom\HTMLDocument selector matching (PHP 8.4+), and automatic Outlook-compatible HTML attribute generation (bgcolor, width, align, etc.). <style> tags are preserved so [@media](https://github.com/media) queries keep working.
Message::buildText(): Trim each text line. (#84)encodeHeader() -> encodeSequence()createAttachment() when content is provided, file name is not changedcreateAttachment() escapes " in filenameFor the details you can have a look at the diff.
getTime()For the details you can have a look at the diff.
read() instead of native file_get_contents() (#69)For the details you can have a look at the diff.
For the details you can have a look at the diff.
For the details you can have a look at the diff.
DKIM can be configured via config file:
mail:
dkim:
domain: ...
selector: ...
privateKey: private.key.file
passPhrase: ...
testMode: ...
<email> #64getConfigSchema()For the details you can have a look at the diff.
mail() exists #52For the details you can have a look at the diff.
For the details you can have a look at the diff.
For the details you can have a look at the diff.
For the details you can have a look at the diff.
For the details you can have a look at the diff.
setHtmlBody() added new syntax for embedded files [[image.gif]] #29addInlinePart() #27For the details you can have a look at the diff.
For the details you can have a look at the diff.
For the details you can have a look at the diff.
For the details you can have a look at the diff.
For the details you can have a look at the diff.
How can I help you explore Laravel packages today?