Repository navigation
SendMail
Pair\Services\Sendmail extends the Mailer base class and sends HTML email through PHP's mail() transport. Use the exact Sendmail spelling so Composer can autoload src/Services/Sendmail.php on case-sensitive filesystems.
send(array $recipients, string $subject, string $title, string $text, array $attachments = [], array $ccs = []): void
Sends an HTML email with recipients and carbon copies normalized by the base mail helper. The attachments argument is accepted for the shared signature but is not used by this transport; use another mailer when attachments are required. A failed mail() call raises EMAIL_FAILURE.
use Pair\Services\Sendmail;
$mailer = new Sendmail([
'fromAddress' => 'noreply@example.com',
'fromName' => 'Example app',
'adminEmails' => ['developer@example.com'],
]);
$mailer->send(
[['name' => 'John', 'email' => 'john@example.com']],
'Welcome',
'Welcome to Pair',
'Your account is ready.'
);The server must provide a working PHP mail transport. Non-production recipient routing follows the base Mailer rules and requires configured administrator addresses.
See also: Mailer, AmazonSes, SmtpMailer.
Home · Setup · Configuration
Build with Pair 4
- Generator
- Controllers and responses
- Read models
- ActiveRecord and queries
- Forms and validation
- PairUI.js and HTML fragments
APIs and authentication
- API guide and CRUD
- Middleware and rate limits
- Users, sessions, and ACL
- Passkeys and social login
- Native mobile setup
Integrate and operate
- Integrations
- Runtime extensions and adapter keys
- Cache and cache stores
- Logs and observability
- PWA and push
- Packages and distribution
- Upgrade to v4