-
Notifications
You must be signed in to change notification settings - Fork 2
SmtpMailer
Viames Marino edited this page Feb 23, 2026
·
1 revision
Pair\Services\SmtpMailer is a Mailer implementation based on PHPMailer SMTP transport.
setConfig(array $config): voidcheckConfig(): voidsend(array $recipients, string $subject, string $title, string $text, array $attachments = [], array $ccs = []): void
fromAddressfromNamesmtpHostsmtpPort- when
smtpAuth=true:smtpUsername,smtpPassword
Optional:
-
smtpSecure(ssl/tls) smtpDebugsmtpAuth
use Pair\Services\SmtpMailer;
$mailer = new SmtpMailer([
'fromAddress' => 'noreply@example.com',
'fromName' => 'Pair App',
'smtpHost' => 'smtp.example.com',
'smtpPort' => 587,
'smtpSecure' => 'tls',
'smtpAuth' => true,
'smtpUsername' => 'smtp-user',
'smtpPassword' => 'smtp-pass',
]);
$mailer->send(
[['name' => 'John', 'email' => 'john@example.com']],
'Welcome',
'Welcome',
'Thanks for joining.'
);