MediaWiki master
Emailer.php
Go to the documentation of this file.
1<?php
7namespace MediaWiki\Mail;
8
10
26class Emailer implements IEmailer {
27
38 public function send(
39 $to,
40 MailAddress $from,
41 string $subject,
42 string $bodyText,
43 ?string $bodyHtml = null,
44 array $options = []
45 ): StatusValue {
46 $body = $bodyHtml ? [ 'text' => $bodyText, 'html' => $bodyHtml ] : $bodyText;
47 return UserMailer::send( $to, $from, $subject, $body, $options );
48 }
49}
Send arbitrary emails.
Definition Emailer.php:26
send( $to, MailAddress $from, string $subject, string $bodyText, ?string $bodyHtml=null, array $options=[])
Definition Emailer.php:38
Represent and format a single name and email address pair for SMTP.
static send( $to, $from, $subject, $body, $options=[])
Send a raw email via SMTP (if $wgSMTP is set) or otherwise via PHP mail().
Generic operation result class Has warning/error list, boolean status and arbitrary value.
Interface for sending arbitrary emails.
Definition IEmailer.php:20