MediaWiki master
MailAddress Class Reference

Stores a single person's name and email address. More...

Public Member Functions

 __construct ( $address, $name=null, $realName=null)
 
 __toString ()
 
 equals (self $other)
 
 toString ()
 Return formatted and quoted address to insert into SMTP headers.
 

Static Public Member Functions

static newFromUser (UserEmailContact $user)
 Create a new MailAddress object for the given user.
 

Public Attributes

string $address
 
string $name
 
string $realName
 

Detailed Description

Stores a single person's name and email address.

These are passed in via the constructor, and will be returned in SMTP header format when requested.

Stability: newable

Definition at line 36 of file MailAddress.php.

Constructor & Destructor Documentation

◆ __construct()

MailAddress::__construct ( $address,
$name = null,
$realName = null )
Stability: stable
to call
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 51 of file MailAddress.php.

Member Function Documentation

◆ __toString()

MailAddress::__toString ( )

Definition at line 106 of file MailAddress.php.

◆ equals()

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

Definition at line 73 of file MailAddress.php.

◆ newFromUser()

static MailAddress::newFromUser ( UserEmailContact $user)
static

Create a new MailAddress object for the given user.

Parameters
UserEmailContact$user
Returns
MailAddress
Since
1.24

Definition at line 64 of file MailAddress.php.

References MediaWiki\Mail\UserEmailContact\getEmail(), MediaWiki\Mail\UserEmailContact\getRealName(), and MediaWiki\Mail\UserEmailContact\getUser().

◆ toString()

MailAddress::toString ( )

Return formatted and quoted address to insert into SMTP headers.

Returns
string

Definition at line 83 of file MailAddress.php.

References $wgEnotifUseRealName, and wfIsWindows().

Referenced by UserMailer\sendInternal().

Member Data Documentation

◆ $address

string MailAddress::$address

Definition at line 42 of file MailAddress.php.

◆ $name

string MailAddress::$name

Definition at line 38 of file MailAddress.php.

◆ $realName

string MailAddress::$realName

Definition at line 40 of file MailAddress.php.


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