Tiger_Mail
@api
Tiger_Mail — a thin, fluent wrapper over Zend_Mail.
Build a message and send it; the TRANSPORT is resolved from the config cascade (so per-deploy overrides + secrets live in local.ini, never in code):
mail.transport = mail | smtp (default: mail = PHP sendmail()) mail.from.email / .name = default sender mail.smtp.host/port/ssl/auth/username/password
(new Tiger_Mail()) ->to('ada@example.com', 'Ada') ->subject('Reset your password') ->html('
Click here
') ->send();A plain-text alternative is auto-derived from the HTML when not set explicitly, so every message is multipart (deliverability). send() throws on a transport failure — callers (the auth services) wrap it and degrade gracefully rather than 500.
Methods
__construct()
__construct()
Capture the resolved config for later transport resolution.
to()
to($email, $name = '')
Add a recipient (chainable).
$emailstring— the recipient email address$namestring— the recipient display name
Returns self — this instance, for chaining
from()
from($email, $name = '')
Set the sender (chainable); overrides the config default.
$emailstring— the sender email address$namestring— the sender display name
Returns self — this instance, for chaining
replyTo()
replyTo($email, $name = '')
Set the Reply-To address (chainable).
$emailstring— the reply-to email address$namestring— the reply-to display name
Returns self — this instance, for chaining
subject()
subject($subject)
Set the subject line (chainable).
$subjectstring— the message subject
Returns self — this instance, for chaining
html()
html($html)
Set the HTML body (chainable); a plain-text alternative is auto-derived if unset.
$htmlstring— the HTML message body
Returns self — this instance, for chaining
text()
text($text)
Set the plain-text body explicitly (chainable).
$textstring— the plain-text message body
Returns self — this instance, for chaining
send()
send($transport = null)
Send the message. Pass a transport to override the config-resolved one (handy for tests — e.g. a Zend_Mail_Transport_File that captures instead of delivers). Throws Zend_Mail_Exception / transport exceptions on failure.
$transportZend_Mail_Transport_Abstract|null— transport override, or null to resolve from config
Returns self — this instance, for chaining
transport()
transport()
The transport for the active config: SMTP (with TLS/auth) when mail.transport=smtp AND a host is set, else PHP mail() (sendmail).
Returns Zend_Mail_Transport_Abstract