Collection of static functions for sending mail.
More...
|
static | quotedPrintable ( $string, $charset='') |
| Converts a string into quoted-printable format.
|
|
static | rfc822Phrase ( $phrase) |
| Converts a string into a valid RFC 822 "phrase", such as is used for the sender name.
|
|
static | sanitizeHeaderValue ( $val) |
| Strips bad characters from a header value to prevent PHP mail header injection attacks.
|
|
static | send ( $to, $from, $subject, $body, $options=[]) |
| This function will perform a direct (authenticated) login to a SMTP Server to use for mail relaying if 'wgSMTP' specifies an array of parameters.
|
|
|
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.
|
|
|
static | errorHandler ( $code, $string) |
| Set the mail error message in self::$mErrorString.
|
|
static | isMailMimeUsable () |
| Whether the PEAR Mail_mime library is usable.
|
|
static | isMailUsable () |
| Whether the PEAR Mail library is usable.
|
|
static | makeMsgId () |
| Create a value suitable for the MessageId Header.
|
|
Collection of static functions for sending mail.
Definition at line 30 of file UserMailer.php.
◆ errorHandler()
static UserMailer::errorHandler |
( |
|
$code, |
|
|
|
$string |
|
) |
| |
|
staticprivate |
Set the mail error message in self::$mErrorString.
- Parameters
-
int | $code | Error number |
string | $string | Error message |
Definition at line 449 of file UserMailer.php.
◆ isMailMimeUsable()
static UserMailer::isMailMimeUsable |
( |
| ) |
|
|
staticprivate |
Whether the PEAR Mail_mime library is usable.
This will try and load it if it is not already.
- Returns
- bool
Definition at line 177 of file UserMailer.php.
◆ isMailUsable()
static UserMailer::isMailUsable |
( |
| ) |
|
|
staticprivate |
Whether the PEAR Mail library is usable.
This will try and load it if it is not already.
- Returns
- bool
Definition at line 191 of file UserMailer.php.
◆ makeMsgId()
static UserMailer::makeMsgId |
( |
| ) |
|
|
staticprivate |
◆ quotedPrintable()
static UserMailer::quotedPrintable |
( |
|
$string, |
|
|
|
$charset = '' |
|
) |
| |
|
static |
Converts a string into quoted-printable format.
- Since
- 1.17
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
- Parameters
-
string | $string | |
string | $charset | |
- Returns
- string
Definition at line 488 of file UserMailer.php.
References $matches.
◆ rfc822Phrase()
static UserMailer::rfc822Phrase |
( |
|
$phrase | ) |
|
|
static |
Converts a string into a valid RFC 822 "phrase", such as is used for the sender name.
- Parameters
-
- Returns
- string
Definition at line 467 of file UserMailer.php.
◆ sanitizeHeaderValue()
static UserMailer::sanitizeHeaderValue |
( |
|
$val | ) |
|
|
static |
Strips bad characters from a header value to prevent PHP mail header injection attacks.
- Parameters
-
string | $val | String to be santizied |
- Returns
- string
Definition at line 458 of file UserMailer.php.
◆ send()
static UserMailer::send |
( |
|
$to, |
|
|
|
$from, |
|
|
|
$subject, |
|
|
|
$body, |
|
|
|
$options = [] |
|
) |
| |
|
static |
This function will perform a direct (authenticated) login to a SMTP Server to use for mail relaying if 'wgSMTP' specifies an array of parameters.
It requires PEAR:Mail to do that. Otherwise it just uses the standard PHP 'mail' function.
- Parameters
-
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 |
- Exceptions
-
- Returns
- Status
Definition at line 93 of file UserMailer.php.
References $wgAllowHTMLEmail, and wfDebug().
◆ sendInternal()
static UserMailer::sendInternal |
( |
array |
$to, |
|
|
MailAddress |
$from, |
|
|
|
$subject, |
|
|
|
$body, |
|
|
|
$options = [] |
|
) |
| |
|
staticprotected |
◆ sendWithPear()
static UserMailer::sendWithPear |
( |
|
$mailer, |
|
|
|
$dest, |
|
|
|
$headers, |
|
|
|
$body |
|
) |
| |
|
staticprotected |
Send mail using a PEAR mailer.
- Parameters
-
Mail_smtp | $mailer | |
string[] | string | $dest | |
array | $headers | |
string | $body | |
- Returns
- Status
Definition at line 43 of file UserMailer.php.
References wfDebug().
◆ $mErrorString
UserMailer::$mErrorString |
|
staticprivate |
The documentation for this class was generated from the following file: