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

  • $email string — the recipient email address
  • $name string — the recipient display name

Returns self — this instance, for chaining

from()

from($email, $name = '')

Set the sender (chainable); overrides the config default.

  • $email string — the sender email address
  • $name string — the sender display name

Returns self — this instance, for chaining

replyTo()

replyTo($email, $name = '')

Set the Reply-To address (chainable).

  • $email string — the reply-to email address
  • $name string — the reply-to display name

Returns self — this instance, for chaining

subject()

subject($subject)

Set the subject line (chainable).

  • $subject string — 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.

  • $html string — the HTML message body

Returns self — this instance, for chaining

text()

text($text)

Set the plain-text body explicitly (chainable).

  • $text string — 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.

  • $transport Zend_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