MediaWiki master
MailAddress Class Reference

Represent and format a single name and email address pair for SMTP. More...

Public Member Functions

 __construct ( $address, $name=null, $realName=null)
 
 __toString ()
 
 equals (self $other)
 
 toString ()
 Format and quote address for insertion in SMTP headers.
 

Static Public Member Functions

static newFromUser (UserEmailContact $user)
 

Public Attributes

string $address
 
string $name
 
string $realName
 

Detailed Description

Represent and format a single name and email address pair for SMTP.

Used by Emailer, e.g. via EmailUser or EmailNotification.

Stability: newable
Since
1.6.0

Definition at line 36 of file MailAddress.php.

Constructor & Destructor Documentation

◆ __construct()

MailAddress::__construct ( $address,
$name = null,
$realName = null )
Stability: stable
to call
Since
1.6.0
Parameters
string$addressString with an email address
string | null$nameHuman-readable name if a string address is given
string | null$realNameHuman-readable real name if a string address is given

Definition at line 49 of file MailAddress.php.

Member Function Documentation

◆ __toString()

MailAddress::__toString ( )

Definition at line 104 of file MailAddress.php.

◆ equals()

MailAddress::equals ( self $other)
Since
1.40
Parameters
self$other
Returns
bool

Definition at line 69 of file MailAddress.php.

◆ newFromUser()

static MailAddress::newFromUser ( UserEmailContact $user)
static

◆ toString()

MailAddress::toString ( )

Format and quote address for insertion in SMTP headers.

Since
1.6.0
Returns
string

Definition at line 81 of file MailAddress.php.

References $wgEnotifUseRealName, and wfIsWindows().

Referenced by UserMailer\sendInternal().

Member Data Documentation

◆ $address

string MailAddress::$address

Definition at line 40 of file MailAddress.php.

◆ $name

string MailAddress::$name

Definition at line 38 of file MailAddress.php.

◆ $realName

string MailAddress::$realName

Definition at line 39 of file MailAddress.php.


The documentation for this class was generated from the following file: