|
MediaWiki master
|
Collection of static functions for sending mail. More...
Static Public Member Functions | |
| static | quotedPrintable ( $string, $charset='') |
| Converts a string into quoted-printable format. | |
| static | send ( $to, $from, $subject, $body, $options=[]) |
| Send a raw email via SMTP (if $wgSMTP is set) or otherwise via PHP mail(). | |
Static Protected Member Functions | |
| static | sendInternal (array $to, MailAddress $from, $subject, $body, $options=[]) |
| Helper function fo UserMailer::send() which does the actual sending. | |
| static | sendWithPear ( $mailer, $dest, $headers, $body) |
| Send mail using a PEAR mailer. | |
Collection of static functions for sending mail.
Definition at line 38 of file UserMailer.php.
|
static |
Converts a string into quoted-printable format.
From PHP5.3 there is a built in function quoted_printable_encode() This method does not duplicate that. This method is doing Q encoding inside encoded-words as defined by RFC 2047 This is for email headers. The built in quoted_printable_encode() is for email bodies
| string | $string | |
| string | $charset |
Definition at line 456 of file UserMailer.php.
Referenced by MediaWiki\Mail\UserMailer\sendInternal(), and MediaWiki\Mail\MailAddress\toString().
|
static |
Send a raw email via SMTP (if $wgSMTP is set) or otherwise via PHP mail().
This function perform a direct (authenticated) login to a SMTP server, to use for mail relaying, if 'wgSMTP' specifies an array of parameters. This uses the pear/mail package.
Otherwise it uses the standard PHP 'mail' function, which in turn relies on the server's sendmail configuration.
| MailAddress | MailAddress[] | $to | Recipient's email (or an array of them) |
| MailAddress | $from | Sender's email |
| string | $subject | Email's subject. |
| string | string[] | $body | Email's text or Array of two strings to be the text and html bodies |
| array | $options | Keys: 'replyTo' MailAddress 'contentType' string default 'text/plain; charset=UTF-8' 'headers' array Extra headers to set |
Definition at line 106 of file UserMailer.php.
References MediaWiki\MainConfigNames\AllowHTMLEmail, MediaWiki\MediaWikiServices\getInstance(), MediaWiki\Mail\UserMailer\sendInternal(), and wfDebug().
|
staticprotected |
Helper function fo UserMailer::send() which does the actual sending.
It expects a $to list which the UserMailerSplitTo hook would not split further.
| MailAddress[] | $to | Array of recipients' email addresses |
| MailAddress | $from | Sender's email |
| string | $subject | Email's subject. |
| string | string[] | $body | Email's text or Array of two strings to be the text and html bodies |
| array | $options | Keys: 'replyTo' MailAddress 'contentType' string default 'text/plain; charset=UTF-8' 'headers' array Extra headers to set |
Definition at line 199 of file UserMailer.php.
References MediaWiki\MainConfigNames\AdditionalMailParams, MediaWiki\JobQueue\Job\factory(), MediaWiki\MediaWikiServices\getInstance(), MediaWiki\SpecialPage\SpecialPage\getTitleFor(), PROTO_CANONICAL, MediaWiki\Mail\UserMailer\quotedPrintable(), MediaWiki\Mail\UserMailer\sendWithPear(), MediaWiki\MainConfigNames\SMTP, MediaWiki\Mail\MailAddress\toString(), wfDebug(), and wfIsWindows().
Referenced by MediaWiki\Mail\UserMailer\send().
|
staticprotected |
Send mail using a PEAR mailer.
| Mail_smtp | $mailer | |
| string[] | string | $dest | |
| array | $headers | |
| string | $body |
Definition at line 52 of file UserMailer.php.
References wfDebug().
Referenced by MediaWiki\Mail\UserMailer\sendInternal().